Click HERE to see how Saviynt Intelligence is transforming the industry. |
09/02/2024 06:18 AM - edited 09/02/2024 06:19 AM
Hi Team, has anyone passed single quotes as an actual value in rest json?
I tried using backslash but didn't work.
Thanks
Solved! Go to Solution.
09/02/2024 06:19 AM
Share json
09/02/2024 06:23 AM
@rushikeshvartak we need to pass a script in http param
Param looks like.
Script:select username, ID from user wher username ='name' and we need to add name in single quotes
09/02/2024 06:27 AM
Add blackslash
09/02/2024 06:29 AM
@rushikeshvartak tried that .. couldn't save the connection.
09/02/2024 06:35 AM
Share error logs / json
09/02/2024 08:08 AM - edited 09/02/2024 08:09 AM
@rushikeshvartak here is the json not working with backslash
{
"name": "call1",
"connection": "acctAuth",
"url": "",
"httpMethod": "POST",
"httpContentType": "application/json",
"httpParams": "${\"Script\":\"Select Username, ID, status, email, displayname, sourceds from User where upper(username) = upper('+'\''+abc+'\''+') ORDER BY Username\"'}",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"successResponses": {
"statusCode": [
200
]
},
"unsuccessResponses": {
"statusCode": [
404,
401,
400
]
}
}
09/02/2024 08:10 AM
"httpParams": "${\"Script\":\"Select Username, ID, status, email, displayname, sourceds from User where upper(username) = upper('\\\\'abc\\\\') ORDER BY Username\"}",
09/02/2024 08:12 AM
@rushikeshvartak need to add single quotes in json
09/02/2024 08:15 AM
Its added in above logic
09/02/2024 08:22 AM
@rushikeshvartak it is adding backslash instead of single quote
\"Script\":\"Select Username, ID, status from user where upper(username) = upper(\\abc\\)
abc is dynamic value which we are picking from task account name
09/02/2024 08:30 AM
"httpParams": "{\"Script\":\"Select Username, ID, status, email, displayname, sourceds from User where upper(username) = upper('\" + abc + \"') ORDER BY Username\"}"
09/02/2024 08:36 AM
@rushikeshvartak , i have already tried above...
i was able to make it work. will share the working one just testing few scenarios.
Thank you!!
09/02/2024 10:27 AM
working Json
"httpParams": "{\"Script\":\"Select Username, ID, status, email, displayname, sourceds from User where upper(username) = upper('\\\" + abc + '\\\''+') ORDER BY Username\"}
Thank you so much @rushikeshvartak for always helping out.