We are delighted to share our new EIC Delivery Methodology for efficiently managing Saviynt Implementations and delivering quick time to value. CLICK HERE.

Rest Error unrecognized token'$' Add access Json

NM
Regular Contributor II
Regular Contributor II

Hello,

I am getting the error during the 2nd call in the below Addaccessjson. Please let me know if there is anything wrong here. when i do the below to operations separately it gives the expected result.

${Map map = new HashMap(); ArrayList responseList=response.Access1.message.permissions.appGroup; int size = responseList.size();
int flag=0;
for (int i=0;i<size;i++)
{
if(responseList.get(i).appGroup.toString() == \"rx_dev\")
{
responseList.get(i).appGroupPermissions = [\"basic_access\"];
flag++;
}
}
if (flag != 1)
{map.put(\"appGroup\",\"tv_test\"); map.put(\"Permissions\",[\"manage_media_library\"]); responseList.add(map);} return responseList;}

First Access call is to get existing entitlement/permission(Not included in the post), call2 to either append or add a new entry.

Thanks

6 REPLIES 6

rushikeshvartak
All-Star
All-Star

Please share full json


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

NM
Regular Contributor II
Regular Contributor II

Add access json

{
"call": [
{
"name": "Access",
"connection": "userAuth",
"url": "https://xxx",
"httpMethod": "GET",
"httpHeaders": {
"Authorization": "${access_token}"
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200
]
}
},
{
"name": "Access",
"connection": "userAuth",
"url": "https://xxx",
"httpMethod": "PUT",
"httpParams": "{\"schemas\":[\"urn:ietf:params:scim:schemas:core:2.0:User\"],\"userName\":\"devtest12@kat\",\"name\":{\"givenName\":\"DevTest12\",\"familyName\":\"Test\"},\"department\":\"engineering\",\"permissions\":{\"companyPermissions\":[],\"appGroup\":${Map map = new HashMap(); ArrayList<String> responseList=response.Access1.message.permissions.appGroup; int size = responseList.size();for (int i=0;i<size;i++){if(responseList.get(i).appGroup.toString() == \"rx_dev\"){responseList.get(i).appGroupPermissions = [\"basic_access\"]; flag=1;}} if (flag != 1)
{map.put(\"appGroup\",\"tv_test\"); map.put(\"Permissions\",[\"manage_media_library\"]); responseList.add(map);} return responseList;}}}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200

]
}
}
]
}

NM
Regular Contributor II
Regular Contributor II

Hi @rushikeshvartak , Anything??

Rishi
Saviynt Employee
Saviynt Employee

@NM is your issue resolved or still looking for assistance?

NM
Regular Contributor II
Regular Contributor II

Hi Rishi,

Yes it is working now. Thanks Amit for your help

 

Regards,

NM

 Can you share working JSON 


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