Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Unable to parse the response correctly in REST Connector

yogesh
Regular Contributor III
Regular Contributor III

We have a rest api which returns below reponse on successful account creation:

 

{
    "resultStatus": "Success",
    "trace": "11/17/2023 2:59:45 AM: Checking if account exists for [xxxxxxx] 11/17/2023 2:59:57 AM: Script Finished ",
    "mail": "xxxxxxxxxx@xxxxx.com",
    "alias": "xxxxxx.xxxxxxx"
}

 

Upon failure it returns this (quotes are included in the response):

 

"Success"

 

OR it may also return this on failure:

 

{
    "resultStatus": "Failed"
}

 

Return Type for all reponses is application/json and status code is also same i.e. 200

First reponse should complete the task and second and third should cause a failure but in second case the task is getting completed. 

I have tried below jsons in connection but every one is causing the task to get completed even when it should fail:

 

            "successResponses": {
                "response[0].resultStatus": "Success"
            },
            "unsuccessResponses": {
                "response[0].resultStatus": "Failed",
                "response.responseMessage": "\"Success\""
            }
            "successResponses": {
                "response[0].resultStatus": "Success"
            },
            "unsuccessResponses": {
                "response[0].resultStatus": "Failed",
                "response[0].responseMessage": "\"Success\""
            }
            "successResponses": {
                "response[0].resultStatus": "Success"
            },
            "unsuccessResponses": {
                "response[0].responseMessage": "\"Success\""
            }
            "successResponses": {
                "response[0].resultStatus": "Success"
            },
            "unsuccessResponses": {
                "response.responseMessage": "\"Success\""
            }

 

 

How do I parse the second type of failure response in this usecase?
We can not differentiate on status code as it is always 200 and the things I've tried above are also not working.

1 REPLY 1

SB
Saviynt Employee
Saviynt Employee

Can you enable ConfigJSON param in the REST connection with value {"showLogs":true}. Once done, run the provisioning job for the task that fails and in the logs search for Got Webservice API Response.

Can you share the log for the task from this point onwards till the end of the provisioning along with the complete JSON you are using.


Regards,
Sahil