Forum Discussion
jeffshurtliff I haven't heard anything, but I had thought there was an active ticket already looking on this. AshishKe can you give an update on on the issues with archiving a message via the API?
- NarendraG4 years agoKhoros Alumni (Retired)
jeffshurtliff The issue is in the request made.
Body should be a json array, for example -
[{"messageId" : "174"}]and an optional "suggestedUrl" can be passed like -
Although it is a JSON array, it can only take one element for now, it was designed keeping the future bulk archive in the mind. For now only one thread id can be sent for archiving in one POST request.
- jeffshurtliff4 years agoBoss
Hi NarendraG,
Thanks for the suggestion. Unfortunately it looks like I couldn't get that to work either. I tried passing both a JSON array and a string but both returned the response "An unexpected error occurred." as the message.
Here is the syntax from my attempts:
<#-- Attempt 1 --> <#assign archivePostCall = restBuilder() .method("POST") .path("/archives/archive") .body([{"messageId": "30042"}]) .admin(true) /> <#assign response = archivePostCall.call() /> Status: ${response.status}<br /> Message: ${response.message}<br /> <#-- Attempt 2 --> <#assign archivePostCall = restBuilder() .method("POST") .path("/archives/archive") .body('[{"messageId": "30042"}]') .admin(true) /> <#assign response = archivePostCall.call() /> Status: ${response.status}<br /> Message: ${response.message}<br />
Below are screenshots of the attempts in Studio:
Related Content
- 4 years ago
- 2 years ago
- 4 years ago
- 4 years ago
- 2 years ago