Click HERE to see how Saviynt Intelligence is transforming the industry. |
07/22/2024 04:46 AM
Hi Team,
I am trying to build add Access JSON with two API calls to send out all entitlements to add roles to the user.
Based on the reference, I was able to build sample JSON to create an Array List that the API expects.
Can anyone please advise on what is missing here? We are running on some tight timelines, really appreciate the quick support.
Below is the code and from logs, I am getting "Unexpected character ('r' (code 114)): was expecting comma to separate Array entries" error.
Solved! Go to Solution.
07/22/2024 04:51 AM
Share full json and logs
07/22/2024 04:59 AM - edited 07/22/2024 05:00 AM
@rushikeshvartak : Please find the attached details. I have only shared required logs as it had sensitive information.
07/23/2024 07:17 PM
Does entitlement Type name is Roles1 and Roles2
07/24/2024 01:44 AM
@rushikeshvartak : There is only one Entitlement Type named "Roles"
07/23/2024 05:28 AM
@rushikeshvartak : Did you get a chance to review the issue?
07/23/2024 05:39 AM
Hi @Amar_Simha , does API expects all existing entitlement to be send?
07/23/2024 06:00 AM
@NM : Yes, that is correct.
08/01/2024 06:26 AM
@rushikeshvartak @NM : I was able to resolve the issue. Thanks for the support.
08/01/2024 06:29 AM
Hi @Amar_Simha , can you share the json it will be helpful for other having same problem.
08/02/2024 06:55 AM
@NM @rushikeshvartak : This is the working logic. Thanks.
"httpParams": "{\"roles\":${List rolesList = new ArrayList();List responseList = response.Roles1.message.roles.collect{it.role_name};if(responseList?.size() == 0){return rolesList;}else{responseList.add(entitlementValue.entitlement_value);int count=0;int size = responseList.size();for(String str: responseList){count++;rolesList.add('{\"role_name\":\"'+str+'\"}');if(count == size){return rolesList;}}}}}"