chrigu
10 years agoGuide
REST response to JSON
Hi there
I'm building an endpoint and I would like to output the response of the following REST call as plain JSON:
<#assign ideaBoards = rest("/categories/id/mycategory/boards/style/idea?restapi.response_style=view") />
Is there way to convert ideaBoards to a JSON string? Or to a normal Hash?
Note: I'm aware that I can calll rest("/categories/id/mycategory/boards/style/idea?restapi.response_format=json") to get a JSON response directly, but I would like to include the response above in my JSON response e.g.:
{
"some": "Some other Text",
"other":[12,3,4],
"ideaBoards":ideaBoards?toJSON
}
Thanks for any hints!
chris