Forum Discussion
We actually added this back in 19.2, but looks like it didn't make it into any release notes or into our Freemarker documentation -- I will make sure this gets added to our Freemarker documentation. In the meantime, you should be able to do this to parse JSON out of the request body:
<#assign requestBody = http.request.body />
<#assign requestBodyObj = utils.json.fromJson(requestBody) />
(Please note that the http.request.body object will only work when used in Endpoints -- it will throw an exception if used in a component on a community page)
-Doug
Hey DougS . Thanks for replying. I tried what you have mentioned above and that doesn't seem to be working when I am sending a webhook to my endpoint where I'm trying to get the request body. I basically just wrote your above-mentioned code and then I'm taking the requestBodyObj and putting it in a restadmin call as a variable to update a metadata field but nothing is getting set over there. Is there a different way to do that with your given code?
Related Content
- 9 years ago
- 12 years ago