Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

Add Access Json throwing "The JSON value could not be converted to System.Int32. Path

AadhithyanS
New Contributor
New Contributor

Hi Team,

Below is the screenshot from postman that the add access API requires.

AadhithyanS_0-1727668265941.png

Below is my Json.

{
"call": [
{
"name": "Roles",
"connection": "userAuth",
"showResponse": true,
"url": "{(BaseUrl)}/AddUserTogroup",
"httpMethod": "PUT",
"httpParams": "{\"userId\": \"${account.accountID}\", \"groupId\": \"${entitlementValue.entitlementID}\"}",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200,
201
]
},
"unsuccessResponses": {
"statusCode": [
400,
401,
405,
500,
501
]
}
}
]
}

But it is throwing an error message errors":{"userGroup":["The userGroup field is required."],"$.userId":["The JSON value could not be converted to System.Int32. Path: $.userId | LineNumber: 0 | BytePositionInLine: 95."]},"traceId":"00-33ca27cf18adb64026821f5d46872022-b2b086ca7d7f69f3-00"},"statusCode":400,"description":null,"status":"Failed"}}

Could some one please help on this? is this because of the double quotes in the payload shown in postman?

Entitlement type is Roles

Regards,

Aadhithyan.S

2 REPLIES 2

rushikeshvartak
All-Star
All-Star

{
"call": [
{
"name": "Roles",
"connection": "userAuth",
"showResponse": true,
"url": "{(BaseUrl)}/AddUserTogroup",
"httpMethod": "PUT",
"httpParams": "{\"userId\": ${account.accountID}, \"groupId\": ${entitlementValue.entitlementID}}",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [200, 201]
},
"unsuccessResponses": {
"statusCode": [400, 401, 405, 500, 501]
}
}
]
}


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

@rushikeshvartak this is the same json that i have pasted on top. i do not see any difference between what i posted and your reply. 

 

apologies i see it. will give it a try