Getting error on Put Method in "http request" activity

Hi All,

I am trying to use PUT Method by using HTTP Request activity, but getting 500 error and sometime getting 400 error.

UiPath Studio version:- 2023.10.4
UiPath.webapi.activites:- 1.18.0 Latest version package

Put Request Json Body:-

image
T
This above file attached in attachment option in http request wizard

For Reference:-

Response:-

Anyone give suggestion, why it is giving error.
And I have ran same format in Postman and it is working their.

Hi @shuklarchana001

I think, I am not using orchestrator URL.

Hi @shuklarchana001 ,

Could you try importing the cURL from Postman into UiPath and see if its able to preview the desired response?

image

Ensure you Validate the cURL request before hitting the end point.

Kind Regards,
Ashwin A.K

Yes, I did try with this one but still it is giving error

@shuklarchana001,

Make sure you are using Body Format as multipart/form-data

image

Thanks,
Ashok :slight_smile:

@ashokkarale I did try with same but getting same error.

hi @shuklarchana001 400 denotes the request is not properly formatted. The json you are passing in the form of attachment why cant you pass it directly in the body?Try with hardcoding the body with your data once. Also after reading the .txt file the var type will be string convert it to jobject and then send it

@muktadir, Yes I did try with body to read text json and store in string variable. but still not working this.

@shuklarchana001 Convert your string variable to jobject. Use deserialze json and then pass it. If this does not work try hardcoding the value and see if that works.

Also have you tested the same json in postman could be your Endpoint requires more info in json

“{“incident”: {“state”: “Closed”}}”

I was trying with this above statement but getting error on body property for expression.

hmm, would it be possible for you to share your endpoint i might be able to configure something.

Convert your string variable to jobject. Use deserialze json and then pass it.
Also have you tested the same json in postman could be your Endpoint requires more info in json

have you tried these steps?

Sorry, I could not share endpoint. And Body property type is string, so it will not accept jobject. And I am using PUT Method.

@shuklarchana001,

Have you tried post method instead of put?

Refer to the docs for the api You could be missing some parameters in your request or the data could be required in a different way. If everything is correct and the same request works in postman then check for hidden headers and parameters in postman and try to include them in UiPath.

@muktadir, Yes you were right there was some hidden request and which was applied in postman but not in http request activity.

Thank you for your solution.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.