Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Add Access JSON not working for REST BASED Connector

shruanand24
New Contributor
New Contributor

For one of the application, we are using REST based connector. We are able to create, update, disable, enable account as well as import account and groups. However, we are not able to grant user access to groups via ADD ACCESS JSON. Update date and time of add access task is changed but there is no error as such being captured. However, the API call is wokring from Postman.

Sharing the JSON as well as Postman body and URL for your reference:

POSTMAN:

Endpoint URL:

1. (PUT) https://abc/userroles/userID

2. (PUT) https://abc/userdcs/userID

shruanand24_0-1718276335175.png

Response:

shruanand24_1-1718276378371.png

ADD ACCESS JSON:

{
"call": [
{
"name": "groups",
"connection": "acctAuth",
"url": "https://abc/userroles/${user.username}",
"httpMethod": "PUT",
"httpParams": "[\"${entitlementValue.entitlement_value}\"]",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200,
201,
204
]
},
"unsuccessResponses": {
"statusCode": [
400,
403,
401,
409,
501,
500,
404
]
}
},
{
"name": "dcs",
"connection": "acctAuth",
"url": "https://abc/userdcs/${user.username}",
"httpMethod": "PUT",
"httpParams": "[\"${entitlementValue.entitlement_value}\"]",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200,
201,
204
]
},
"unsuccessResponses": {
"statusCode": [
400,
403,
401,
409,
501,
500,
404
]
}
}
]
}

 

6 REPLIES 6

pmahalle
All-Star
All-Star

Hi @shruanand24 

Your API expects only list of roles to be added in the request payload? Is there any error in logs? Can you request and response in the logs?

Can you try below and check once.

{
"call": [
{
"name": "groups",
"connection": "acctAuth",
"url": "https://abc/userroles/${user.username}",
"httpMethod": "PUT",
"httpParams": "{[\"${entitlementValue.entitlement_value}\"]}",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200,
201,
204
]
},
"unsuccessResponses": {
"statusCode": [
400,
403,
401,
409,
501,
500,
404
]
}
},
{
"name": "dcs",
"connection": "acctAuth",
"url": "https://abc/userdcs/${user.username}",
"httpMethod": "PUT",
"httpParams": "{[\"${entitlementValue.entitlement_value}\"]}",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200,
201,
204
]
},
"unsuccessResponses": {
"statusCode": [
400,
403,
401,
409,
501,
500,
404
]
}
}
]
}

 


Pandharinath Mahalle(Paddy)
If this reply helps your question, please consider selecting Accept As Solution and hit Kudos 🙂

shruanand24
New Contributor
New Contributor

hi @pmahalle  I tried the payload you shared but no luck. And yes the API only expect roles names to be mentioned in the request body. Also, sharing the logs for your reference.

Does call name and entitlement type name matching?


Regards,
Rushikesh Vartak
If you find this response useful, kindly consider selecting 'Accept As Solution' and clicking on the 'Kudos' button.

I updated the call name to the entitlement type name, atleast I see error getting printed now. I am using below JSON:

{
"call": [
{
"name": "Security Role",
"connection": "acctAuth",
"url": "https://abc/userroles/${user.username}",
"httpMethod": "PUT",
"httpParams": "{\"${entitlementValue.entitlement_value}\"}",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200,
201,
204
]
},
"unsuccessResponses": {
"statusCode": [
400,
403,
401,
409,
501,
500,
404
]
}
},
{
"name": "Location",
"connection": "acctAuth",
"url": "https://abc/userdcs/${user.username}",
"httpMethod": "PUT",
"httpParams": "{\"${entitlementValue.entitlement_value}\"}",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200,
201,
204
]
},
"unsuccessResponses": {
"statusCode": [
400,
403,
401,
409,
501,
500,
404
]
}
}
]
}

and this is the error:

"Security Role":{"message":"Unexpected character ('}' (code 125)): was expecting a colon to separate field name and value\n at [Source: {\"Wire Cutter_NA\"}; line: 1, column: 19]","status":"Failed"}}

@shruanand24 ,

Seems like URL is wrong, you copies https twice. Try below

{
"call": [
{
"name": "Security Role",
"connection": "acctAuth",
"url": "https://azlwmxbolt01d.wescodist.com/wmx/rest/security/userroles/${user.username}",
"httpMethod": "PUT",
"httpParams": "[\"${entitlementValue.entitlement_value}\"]",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200,
201,
204
]
},
"unsuccessResponses": {
"statusCode": [
400,
403,
401,
409,
501,
500,
404
]
}
},
{
"name": "Location",
"connection": "acctAuth",
"url": "https://azlwmxbolt01d.wescodist.com/wmx/rest/security/userdcs/${user.username}",
"httpMethod": "PUT",
"httpParams": "[\"${entitlementValue.entitlement_value}\"]",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200,
201,
204
]
},
"unsuccessResponses": {
"statusCode": [
400,
403,
401,
409,
501,
500,
404
]
}
}
]
}

 


Pandharinath Mahalle(Paddy)
If this reply helps your question, please consider selecting Accept As Solution and hit Kudos 🙂

shruanand24
New Contributor
New Contributor

This worked, thank you!