API profile - POST request body
I am creating an API profile for Feefo authentication - https://support.feefo.com/support/solutions/articles/8000041717-api-authentication.
It requires a POST request, sending several credential parameters in the body.
I found several examples, which indirectly show how to do that:
The relevant part of my script looks like this:
<rsb:set attr="uri" value="http://api.feefo.com/api/apiauthenticate" />
<rsb:set attr="method" value="POST" />
Testing and running live fail with "No credentials provided" - this is the response when no body or incorrect body is passed.
After I found out about logging the API requests, I can see the body is url-encoded i.e. "7B+%22authenticationDTO%22%3A+%7B++++++%22merchantIdentifier%22%3A...." which is what causes the problem.
I tried the following with no success:
- replace double quotes with ", no other special characters for XML are found in the json;
- use jsonescape() as per CDATA docs - unsupported in Matillion;
- pass the json string as an input parameter;
- set the string with 'value' attribute of rsb:set;
I am aware I can do that using python, but it seems a fairly straightforward case for an API profile, so I would like to understand what is the right way to do it.