browneandrae
6 years agoExpert
Creating a message via api , allowing likes
Using the below to make a post call to create a message or a message reply however after creating I cannot like the message and it is saying kudos is disabled, what property do I have to use to allow for kudos/likes to be given for an api created message
<#compress>
${http.response.setContentType("application/json")}
<#assign messagePostCall = restBuilder()
.method("POST")
.path("/messages")
.body({
"type": "message",
"parent": {
"type" : "message",
"id": http.request.parameters.name.get("message[message_id]")
},
"subject": "User Reply",
"body": http.request.parameters.name.get("message[message_content]"),
"board": {
"id" :http.request.parameters.name.get("message[board_id]"),
"type": "board"
},
"is_draft": false,
"can_accept_solution": true
})
.admin(true) />
<#assign resp = messagePostCall.call() />
<#assign responseBuild = '{"success":true,"message_id":${resp.data.id} }' />
${responseBuild}
</#compress>
Hi browneandrae, Is the author of the post (created via API) same as the user giving kudo to that post? If yes, then it is expected behavior as you cannot kudo your own post.
If that is not the case, then please provide more details of the issue you are seeing.
Thanks,
Srujana.