Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

API profile - POST request body


I am creating an API profile for Feefo 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="" />
<rsb:script method="GET">
<rsb:set attr="method" value="POST" />
<rsb:set attr="data">
"authenticationDTO": {
"merchantIdentifier": "xxxxxxxxxx",
"username": "",
"password": "xxxxxxx",
"apiKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxx"

<rsb:call op="jsonproviderGet">
<rsb:push />


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 &quot, 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.


2 Community Answers

Matillion Agent  

Kalyan Arangam —

Hi Danali,

The driver may attempt to urlencode the POST body and found that adding a ContentType header helps.
Please check if adding the following line before the “URI” attribute helps.

<rsb:set attr="ContentType" value="application/json; charset=UTF-8" />


Danail Georgiev —

It did the trick indeed.
Thanks a lot!

Post Your Community Answer

To add an answer please login