Forum Discussion

browneandrae's avatar
4 years ago

Api V2 Update message version 2 does not work

I use api v1 to move a message which works however when I try and assign a parent to it to make it nested after moving it , it does not update the parent or topic. Following the documentation correctly here https://developer.khoros.com/khoroscommunitydevdocs/reference/messages-1#update-message . It's not clear what requirements are needed to update the message but the documentation says those two properties parent and topic should be updatable.

<#assign pathConstruct = "/messages/id/${messageId}/move/board/id/${newBoard}" />

<#assign apiResults = restadmin(pathConstruct) />

 


<#assign messagePostCallParent = restBuilder()
.method("PUT")
.path("/messages/${messageId}")
.body({

"type": "message",
"parent": "${parentIdParent}",
"topic" : {"id":"${parentIdParent}"}
})
.admin(true) />
<#assign respParent = messagePostCallParent.call() />

  • SuzieH's avatar
    SuzieH
    Khoros Alumni (Retired)

    Hi browneandrae. I'm looking into this. Did you get any kind of error response, or did you just get a 200 (OK), but the message wasn't assigned to the correct parent (or wasn't nested at all). 

    Also, was the original message a topic or a reply? Not sure that that would make a difference, but figure I'd check just in case.

    AshishKe Is this something your team can look at? The PUT request above seems like it should work. I tried to set the parent of a reply to be a different (existing) topic, but I also received an error.

     

    • browneandrae's avatar
      browneandrae
      Expert

      SuzieH it was 200 ok if I included other properties like context_id and updated that it would update. The api v1 move message worked but it can't move to a nested position. It seems like setting the topic and parent objects were just ignored. However I don't need to use this anymore since the spam api calls were added. However, at the time I needed this, it was not working from what it looks like.

       

      • SuzieH's avatar
        SuzieH
        Khoros Alumni (Retired)
        Thanks so much for following up. I'd still like to get your initial use case worked out in the documentation, so I'll continue to work internally with Engineering. Cheers!