Click HERE to see how Saviynt Intelligence is transforming the industry. |
10/24/2024 02:57 AM
Hello,
One system is logically divided into several endpoints in Saviynt. If a user has an account in one endpoint and request access to another endpoint (of same target system), create account task and add access task are created in Saviynt. Since the user already has an account in the target system then that system return 409 (Duplicate entry) error code when the create account action is executed.
Can we check first if account already exist and then depending on the response decide whether the call for creation will be executed?
Something like this code below, can we have an IF statement in the configuration?
"call": [
{
"name": "call1",
"callOrder": 0,
"connection": "acctAuth",
"url": "https://app.test.com/api/Users/?filter=emails%20eq%20%22${user.email}%22",
"httpMethod": "GET",
"httpHeaders": {
"Authorization": "Bearer ${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [200, 204]
}
},
{
"name": "call2",
"callOrder": 1,
"connection": "acctAuth",
"url": "https://app.test.com/api/Users",
"httpMethod": "POST",
"httpParams": "{\"name\":{\"familyName\":\"${user.lastname}\",\"givenName\":\"${user.firstname}\"},\"active\":true}",
"httpHeaders": {
"Authorization": "Bearer ${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [200, 201, 409]
},
"if": "response.call1.message.totalResults == 0"
}
]
10/24/2024 04:15 AM
@itinjic 2 possible solution
1) do a get call in create account json get the identity and map id it doesn't exist create one.
2) mapped endpoint configuration in endpoint will also fullfill your requirement.
10/24/2024 04:52 AM
For this 1) do a get call in create account json get the identity and map id it doesn't exist create one.
How to check this map id it doesn't exist create one?
Please look the code I wrote
10/24/2024 04:57 AM
@itinjic call 2 connection
"connection":" ${(response.call1.message.totalResults==0)?'acctAuth' :'' }"
Try this