Leveraging Intelligent Recommendations for Operational Transformation. AMS Partners click HERE | EMEA/APJ Partners click HERE |
10/16/2023 05:26 AM
Can anyone help here
We have a use case where existing role of user gets returned in Array of String, when user request for new entitlements, AddAccess JSON should get current entitlement and then add new requested entitlements. The call is returning existing entitlements
We are trying the JSON but getting error
"Designations2":{"message":"Unrecognized token '$': was expecting ('true', 'false' or 'null')\n at [Source: {\"employeeid\": \"${response.Designations1.message.Users[0].EmployeeID}\", \"employeename\": \"${response.Designations1.message.Users[0].EmployeeName}\", \"emailaddress\": \"${response.Designations1.message.Users[0].EmailAddress}\",\"designationcodes\": ${List roleNameList = new ArrayList(); roleNameList=response.Designations1.message.Users[0].DesignationCodes.collect{it.toString()};List newRole = new ArrayList();newRole=newRole.add(entitlementValue.entitlementID);newRole.addAll(roleNameList);return newRole;}, \"flag\": \"update\" }; line: 1, column: 243]","status":"Failed"}}
Add Access JSON:
{
"call": [
{
"name": "Designations",
"connection": "userAuth",
"url": "https:/xxxxx/webapistg/api/Saviynt/GetUserList/${account.accountID}",
"httpMethod": "GET",
"httpParams": "",
"httpHeaders": {
"Authorization": "${access_token}",
"httpContentType": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200,
201
]
},
"unsuccessResponses": {
"statusCode": [
400,
401
]
}
},
{
"name": "Designations",
"connection": "userAuth",
"url": "https://xxxxx/webapistg/api/Saviynt/UserService",
"httpMethod": "POST",
"httpParams": "{\"employeeid\": \"${response.Designations1.message.Users[0].EmployeeID}\", \"employeename\": \"${response.Designations1.message.Users[0].EmployeeName}\", \"emailaddress\": \"${response.Designations1.message.Users[0].EmailAddress}\",\"designationcodes\": ${List roleNameList = new ArrayList(); roleNameList=response.Designations1.message.Users[0].DesignationCodes.collect{it.toString()};List newRole = new ArrayList();newRole=newRole.add(entitlementValue.entitlementID);newRole.addAll(roleNameList);return newRole;}, \"flag\": \"update\" }",
"httpHeaders": {
"Authorization": "${access_token}",
"Content-Type": "application/json",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200
]
},
"unsuccessResponses": {
"statusCode": [
400,
401
]
}
}
]
}
Solved! Go to Solution.
10/16/2023 07:41 AM
@rituparna_pwc : I see a JSON format issue,(Missing double quotes for designationcodes.
Can you try below JSON
{
"call": [
{
"name": "Designations",
"connection": "userAuth",
"url": "https:/xxxxx/webapistg/api/Saviynt/GetUserList/${account.accountID}",
"httpMethod": "GET",
"httpParams": "",
"httpHeaders": {
"Authorization": "${access_token}",
"httpContentType": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200,
201
]
},
"unsuccessResponses": {
"statusCode": [
400,
401
]
}
},
{
"name": "Designations",
"connection": "userAuth",
"url": "https://xxxxx/webapistg/api/Saviynt/UserService",
"httpMethod": "POST",
"httpParams": "{\"employeeid\": \"${response.Designations1.message.Users[0].EmployeeID}\", \"employeename\": \"${response.Designations1.message.Users[0].EmployeeName}\", \"emailaddress\": \"${response.Designations1.message.Users[0].EmailAddress}\",\"designationcodes\": \"${List roleNameList = new ArrayList(); roleNameList=response.Designations1.message.Users[0].DesignationCodes.collect{it.toString()};List newRole = new ArrayList();newRole=newRole.add(entitlementValue.entitlementID);newRole.addAll(roleNameList);return newRole;}\", \"flag\": \"update\"}",
"httpHeaders": {
"Authorization": "${access_token}",
"Content-Type": "application/json",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200
]
},
"unsuccessResponses": {
"statusCode": [
400,
401
]
}
}
]
}
10/16/2023 11:10 AM
@Saathvik , it was resolved with below JSON
{
"call": [
{
"name": "Designations",
"connection": "userAuth",
"url": "https://xxxxxxxxxxxxxxxxx/webapistg/api/Saviynt/GetUserList/${account.accountID}",
"httpMethod": "GET",
"httpParams": "",
"httpHeaders": {
"Authorization": "${access_token}",
"httpContentType": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200,
201
]
},
"unsuccessResponses": {
"statusCode": [
400,
401
]
}
},
{
"name": "Designations",
"connection": "userAuth",
"url": "https://xxxxxxxxxxxxxxxxxx/webapistg/api/Saviynt/UserService",
"httpMethod": "POST",
"httpParams": "{\"employeeid\": \"${response.Designations1.message.Users[0].EmployeeID}\", \"employeename\": \"${response.Designations1.message.Users[0].EmployeeName}\", \"emailaddress\": \"${response.Designations1.message.Users[0].EmailAddress}\",\"designationcodes\": ${List oldGroupList = response.Designations1.message.Users[0].DesignationCodes; oldGroupList.add(entitlementValue.entitlementID); return new com.fasterxml.jackson.databind.ObjectMapper().writeValueAsString(oldGroupList);}, \"flag\": \"update\" }",
"httpHeaders": {
"Authorization": "${access_token}",
"Content-Type": "application/json",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200
]
},
"unsuccessResponses": {
"statusCode": [
400,
401
]
}
}
]
}