API response returning Invalid JSON Code 400

Hey Everyone, I am trying to send POST request from UiPath Studio HTTP Request Activity but I am receiving the error shown in the screenshot attached below. But when I use the same CURL in postman it sends me the expected response. So I don’t know were is the issue.

Any help will highly be appreciated.

@Muhammad_Anas_Baloch

As per error the input parameter json you are sending is invalid…please check the same…or show here what you are sending

cheers

Check the headers in UiPath that they match those in Postman, especially the Content-Type header which should be set to ‘application/json’.

For the HTTP Request activity, you usually do this in the “Body” property in the Properties Panel so make sure the JSON in UiPath is properly structured. Missing or extra commas, quotation marks, or braces can cause an ‘Invalid JSON’ error.

If your JSON has special characters, you might have to add escape characters in UiPath, even if you didn’t need to do this in Postman.

can you share your input data?
i believe UiPath isn’t happy with your json format. postman support more JSON specifications then UiPath.

@Anil_G @Nicholas_Noel-Labieniec @Catfish1115 , This is what I am passing.

What’s the content of the HTTP POST request? I see in your screenshot that the Body property is blank. You should put whatever you used in postman in the Body property then try sending the request again.

image

Still same error after adding the body :frowning:

The format of your request body when sending from Postman, was it application/json or some other format?

Yes it is application/json @yikwen.goo

@Muhammad_Anas_Baloch

Can you please show what are you trying to post?

Cheers

@Anil_G here the screenshot what I am trying to post.