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

unsuccessResponses in REST connector

shivmano
Regular Contributor III
Regular Contributor III

Hi Team - 

I have a REST application, that returns a 200 status code for Add Access both in case of success and failure. Below is the response in case of failure and the add access json I am using. I would like to map the "isSuccess": false response item in the unsuccessResponses so that the task does not move to completed, when there is an error. Please can anyone advise how this can be read? 

Failure response:

{
    "operationResult": {
        "userId": null,
        "isSuccess": false,
        "errors": [
            {
                "key": 5102,
                "value": "You are trying to invite a user from outside your directory, but something went wrong. Please contact support."
            }
        ],
        "result": null
    },
    "isSuccess": false,
    "userEntitlement": null
}
 
Add Access JSON I am using currently:
 
{
"call": [
{
"name": "OrgNew",
"connection": "userAuth",
"url": "https://******/${entitlementValue.entitlement_value}/_apis/UserEntitlements?api-version=6.0-preview.1",
"httpMethod": "POST",
"httpParams": "{\"accessLevel\": {\"accountLicenseType\": \"${requestAccessAttributes.get('typeofaccess')}\"},\"user\": {\"principalName\": \"${account.name}\",\"subjectKind\": \"user\"}}",
"httpHeaders": {
"Content-Type": "application/json",
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200,
201
]
},
"unsuccessResponses": {
"statusCode": [
400,
401,
403,
404,
408,
500
]
}
}
]
}
2 REPLIES 2

NM
Honored Contributor III
Honored Contributor III

Hi @shivmano , remove stausCode and add

 "isSuccess": [false] or  "isSuccess"false


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

shivmano
Regular Contributor III
Regular Contributor III

Thank you @NM , I was able to use "operationResult.isSuccess": false