Passing JSON Variable in HTTP POST

Hello,

I am facing a weird issue with the below JSON body when I have tested it manually by assigning some hardcode values in variables and then doing an API call I can hit and upload details successfully.

But when I am extracting values from pdf and assigning it to variables and using the JSON body I am getting this error.

Any wrong in this Body:-

“{”“Name”“: “”” &NAME1.ToString &“”“,”“AccountNo”“: “”” &ACCOUNTNU1 &“”“}”

errror

Thanks

@Pavan_Srikar
Hi, in the code below the variable is TokenID.

“{ ““grant_type”” : ““refresh_token””, ““client_id”” : ““8DEv1AMNXcz””, ““refresh_token”” : “”” + TokenID + “”" }"

on local it has variable, use three double legs (" " ")

@Pavan_Srikar the HTTP 500 error is thrown by your server, so it’s hard for us to know why that happens. However, if I look at the full response, with the error message and believe that that is the case, then it means you’re not encoding your body properly.

Can you try to log the body before sending it to the server to check if it contains valid JSON?

Hello Pavan,
Check out this very fast simple VB.NET that create JSON in 1 line:
startUiPathFromSalesforce/CreateJSON.txt at master · cristinegulescu/startUiPathFromSalesforce · GitHub

Thanks,
Cristian