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

howto get attribute values from first call in second call within REST Connector

alc
Regular Contributor
Regular Contributor

Hello,

We have configured REST Connector, it works fine for creation.

When we configure UpdateAccountJSON, we need two calls, first call to get the account data, second call will use the data from first call if we cannot get it from requestAttributes object.

The first call return account data like below. how can I get the value of email, departements respectively and set it in second call of attribute setting? I did it as below but does not work:

\"email\": \"${response.call1.message.status?.data[0].email}\",
\"departments\": [${'\"' + response.call1.message.status?.data.departments?.toString().replace('[','').replace(']','').replace(',','\",\"') +'\"'}],

{
"status": {
"data": [
{
"id": "13001",
"first_name": "fname1",
"last_name": "sname1",
"username": "login1",
"email": "login1@mycompany.com",
"location": "City, State",
"type": "account type",
"status": "Active",
"departments": [
"dept1", "dept2"
],
"groups": [
"Group2OfDept1","Group3OfDept2"
]
}
]
}
}

Thanks

2 REPLIES 2

rushikeshvartak
All-Star
All-Star
  • Please share full json
  • if you are facing issue with current configuration, please share logs in text file

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

alc
Regular Contributor
Regular Contributor

Hello Rushikesh, Thanks for your help.

Attached is the AddAccess JSON file (testing purpose) since we don't have dedicated add access API, we use update user API for Add Access.

The departments attribute is an array/list attribute, its setting have issues. you can check log file with Unrecognized token error.

However, even we remove this attribute, other attributes setting is OK, the request sent to backend server. but it respond with email value error, location error, password error etc. so it means their settings did not get actual value from first API call. it would be great if you show how to get departments attribute and other attributes setup correctly, the first call response is in log file as well, you can see the data structure by search "Group1"

Thanks for your review!