May 23, 2019, 2:52pm
Hi. I’m currently trying to request the following API, here’s how it looks like in Postman:
It’s supposed to respond with a “requestSent”: true, but it keeps on returning a 415 Error, kindly check last pic
And here’s how the request looks in the
HTTP request wizard (UiPath Activity)
And this is the error I get:
Are my parameters modified incorrectly, how can I make this work?
Simple enough question, however, have you placed your parameter values in quotations in UiPath
May 23, 2019, 3:41pm
Instead of putting in your json variables as parameters, take the json exactly as you see in postman and put in the body of the request. See if that works.
May 23, 2019, 4:12pm
How do I do this? There’s no body to input the request payload. Just a ‘add a parameter’ button
May 23, 2019, 4:20pm
Once you close the wizard and look at the HttpClient properties, you’ll see Body under options. Put your payload here. I don’t see that option in the wizard.
May 24, 2019, 2:43am
@tmays, I tried this, but I don’t know how to debug this error:
I just copied and pasted the exact request body from postman to the properties.
May 24, 2019, 6:07am
@ronanpeter, I tried to put double quotations but it prompted a different error, I don’t think quotations are needed when supplying the value of the parameters.
I also tried to add the parameters one by one in the properties editor and this is what I get as a response:
I tried looking it up, and it said that it might be because of an unsupported format.
Here’s my Body Format:
May 24, 2019, 10:54am
@UiP_Mc. I think your BodyFormat is fine as application/json and @ronanpeter is correct about the double quotes (in places).
For the key value pair, the key is not quoted and the value, if string, requires a double quote. The start of your body should look like this:
requesterName : ““engineer bob””,
The beginning single quote starts the string, no quotes around the key of the key/value pair (because they’re already included as part of the overall string), and double quotes around the value of the key/value pair. Those will be changed to single quotes when processed.
Let me know how this works out.
May 24, 2019, 10:57am
Hi. I found a solution to this from a similar case:
Am not sure whether you were able to resolve the issue.
But the spaces in the body are not supported by UiPath as valid.
Also, double quotes are supposed to be escaped by double quotes to ensure they are consumed as them.
So the required format should be:
So the Body(String) shouldn’t have a single space, and everything should be double quoted e.g. “”“requisitionNumber”“:”“123"”,““requisitionDescription””:““sample Description””"
May 24, 2019, 11:12am
So the double quotes around the key worked?
May 27, 2019, 8:12am
Yup. It has to be enclosed like a string
June 1, 2019, 2:45pm
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.