Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

REST : 'remove access' use case with multiple REST API calls

IGAQ
Regular Contributor
Regular Contributor
Hello All,
We have REST app Integration - we need to handle the remove access/entitlement use case with multiple REST API calls, please find below.
 
Call 1: Perform a GET request to retrieve the assigned entitlements for the given account ID. below is the response.
 
"resources": [
    {
      "id": 333,
      "roleId": 9,
      "userId": 220,
      "roleName": "Abc",
     
    },
    {
      "id": 334,
      "roleId": 10,
      "userId": 220,
      "roleName": "Xyz" }
  ]
 
Call 2: Iterate through the assigned entitlements list to find the relationship ID corresponding to the given roleId. If found, need to pass to Call 3.
 
Suppose roleId is 10 ( from ARS task), I need to pick 334 as relationship id, How to do this conditional check ?
 
Call 3: Perform a DELETE request to remove the entitlement using the relationship ID.
 
Can you share any samples for Call2 ?
 
Thanks,sb
7 REPLIES 7

NM
Esteemed Contributor
Esteemed Contributor

Hi @IGAQ , you have to merge call 2 and 3 as ideally call2 isn't an actual call to application.

And also is that if static value for entitlement, is so you can store it in an entitlement customproperty.


If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'

IGAQ
Regular Contributor
Regular Contributor

Hello @NM 

If merge the calls how to get specific element from the results, Can you share any sample ?

Thanks,

 

rushikeshvartak
All-Star
All-Star

You can store mapping in accounts customproperty and use in rest connector


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

IGAQ
Regular Contributor
Regular Contributor

Hello @rushikeshvartak    How to store multiple values like this  CP1 = 333,334

and check against remove access task ?  Can you share any example  JSON ?

 

Thanks,

use #CONST and javascript to concat multiple value.

I dont have sample on it.


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

IGAQ
Regular Contributor
Regular Contributor

Thank you all for response , below JSON is worked for me.

{
"call": [
{
"name": "Roles",
"connection": "userAuth",
"url": "@@URL?userId=${account.accountID}",
"httpMethod": "GET",
"httpParams": "{}",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200,
201
]
},
"unsuccessResponses": {
"statusCode": [
400,
401,
403,
404,
405,
406,
415
]
}
},
{
"name": "Roles",
"connection": "userAuth",
"url": "@@URL/UserRole/${for (Map map : response.Roles1.message.resources){if (map.roleId.toString().equals(entitlementValue.entitlementID)){return map.id;}}}",
"httpMethod": "DELETE",
"httpParams": "{}",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
204,
200,
201
]
},
"unsuccessResponses": {
"statusCode": [
400,
401,
403,
404,
405,
406,
415
]
}
}
]
}

👍Please click the 'Accept As Solution' button on the reply (or replies) that best answered your original question.


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.