Click HERE to see how Saviynt Intelligence is transforming the industry. |
09/29/2024 08:56 PM
Hi Team,
Below is the screenshot from postman that the add access API requires.
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
09/29/2024 10:06 PM
{
"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]
}
}
]
}
09/29/2024 10:11 PM - edited 09/29/2024 10:12 PM
@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
09/29/2024 11:29 PM
Can you check few more items :
1. connection name added here
2. httpMethod. Is it PUT ot PATCH