I am exposing an API and using OnRequest to preprocess some data. I have set it to Request.RequestText but how do I retrieve this data from the API methods?
I have tried using GetRequestContent from HTTPRequestHandler Extension but to no avail.
Hi Jeremy, you need to parse the RequestText with the JSON deserializer. I would recommend debugging to find the exact formatting of the JSON, then create a structure for it.
You can then make your changes and after that you can serialize again to execute the rest of the request.
Hmmm. But how do I get the Request from the API Methods? I am trying to get the data that is set to Request.RequestText, which in turn is set to the output parameter CustomizedRequest in the OnRequest Callback
The below is OnRequest
Just use the input parameter in this OnRequest action:
Yes, this Input Parameter is in the OnRequest API and I have set CustomizedRequest = Request. So the question is... how do I retrieved CustomizedRequest (or event Requst) from the API methods? In the particular case, it will be "EmailStatus".
Hi
You can simply add an input parameter named eg. Request and set its data type to Text. That parameter will hold the complete Body text then. If your request is a json document you can also set Request to a Data structure with configured Name in JSON settings.
Best
Stefan
Any update on this question ? having the same question