Forum Discussion
NarendraG
Khoros 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.
jeffshurtliff
4 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
- 19 days ago
- 19 days ago
- 19 days ago
- 19 days ago
- 19 days ago