REST Endpoint Task: not able pass JSON as input payload to POST request body

I am trying to make a simple POST request with message body payload as JSON object.

This doesn't work.  The endpoint is rejecting my request because it is expecting a JSON object whereas it is getting a string.

I have specified content-type header as application/json.  requestBody is from a variable of type JSON.

Please suggest the next steps...

Solved Solved
0 2 119
1 ACCEPTED SOLUTION

Hi msaxena,

Thanks for reaching out. Regarding the request body payload, what does your string request payload look like? In particular, you don't have to manually include the escapes in the string. For example, assuming your json is {"name": "John"}, you want to simply provide the string name as is. Below is an example of defining a string variable used as the REST request body. Can you give it a try? Please let us know if this still doesn't work. In that case, please let us know how you set your string value, so we can help.

Thanks!

 

zhuht_0-1718660127244.png

View solution in original post

2 REPLIES 2

Hi msaxena,

Thanks for reaching out. Regarding the request body payload, what does your string request payload look like? In particular, you don't have to manually include the escapes in the string. For example, assuming your json is {"name": "John"}, you want to simply provide the string name as is. Below is an example of defining a string variable used as the REST request body. Can you give it a try? Please let us know if this still doesn't work. In that case, please let us know how you set your string value, so we can help.

Thanks!

 

zhuht_0-1718660127244.png

Thank you so much for your response.  I created a new Integration and it worked.  

When I went back to previous version, it didn't work.  So I downloaded the Integration for the version that worked and the one that didn't, and they are same except one change.  The version that didn't work has an additional attribute: 

"lockHolder": "myemail",