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

Define success for API call based on message received in API response

AS5278
Regular Contributor II
Regular Contributor II

Hi,

We want to explicitly define that if a particular message is coming in the API response, the task should go to Completed tasks with status as success.

The API response is as below:

{"call":{"headers":{"Transfer-Encoding":"chunked","X-Content-Type-Options":"nosniff","X-ORACLE-DMS-ECID":"0061A9BtahGAXNR_uXCCyX0007Zj0003FZ","Connection":"keep-alive","X-ORACLE-DMS-RID":"0:5","Date":"Tue, 05 Sep 2023 20:16:06 GMT","AKGRN":"0.b71fc917.1693944964.3a86d706","Referrer-Policy":"origin","Strict-Transport-Security":"max-age=31536000; includeSubDomains","Cache-Control":"no-cache, no-store, must-revalidate","Vary":"Accept-Encoding","X-XSS-Protection":"1; mode=block","Link":"<https://xxxxxxxx.oraclecloud.com:443/fscmRestApi/resources/xx.xx.xx.xx/dataSecurities/30000049281276...>;rel=\"self\";kind=\"item\";name=\"dataSecurities\"","Content-Language":"en","Content-Type":"application/vnd.oracle.adf.resourceitem+json","Location":"https://xxxxxxxx6.oraclecloud.com:443/fscmRestApi/resources/xx.xx.xx.xx/dataSecurities/3000004928127...","REST-Framework-Version":"1"},"message":{"responseMessage":"A record with this combination of values already exists."},"statusCode":400,"description":null,"status":"Failed"}}

Can we achieve this?.

I tried below but none of them worked:

1). 

"successResponses": [
{
"message": "Success"
},
{
"message": "A record with this combination of values already exists."
}
]
 
2). 
"successResponses": {
"message.responseMessage": "A record with this combination of values already exists.",
"statusCode": [
200,
201,
204
]
}
 
3). 
"successResponses": {
"message": "A record with this combination of values already exists."
}
 
4).
"successResponses": {
"responseMessage": "A record with this combination of values already exists."
}
 
5).
"successResponses": {
"response.message.responseMessage": "A record with this combination of values already exists."
}
 
6).
"successResponses": {
"call.message.responseMessage": "A record with this combination of values already exists."
}
 
 
Please guide.
 
Thanks,
Atul Singh
 
[This post has been edited by a Moderator to remove sensitive information.]
xurde
5 REPLIES 5

SB
Saviynt Employee
Saviynt Employee

Can you try with the below and see if it works.

"successResponse": ["A record with this combination of values already exists."],
"successResponsePath": "message.responseMessage"


Regards,
Sahil

AS5278
Regular Contributor II
Regular Contributor II

@SB 

I tried with the above approach. The task is still remaining in pending tasks. It is not going to Completed Tasks even if responseMessage is: "A record with this combination of values already exists."

This is important for us to achieve as otherwise we won't be able to go live with the application.

Please guide as to how we can achieve this.

Thanks,

Atul Singh

xurde

SB
Saviynt Employee
Saviynt Employee

Can you share the complete JSON and the log for 1 task. 

Ensure to update ConfigJSON param in the REST connection with value {"showLogs":true} before running the provisioning job.


Regards,
Sahil

AS5278
Regular Contributor II
Regular Contributor II

@SB

We are still stuck with this issue.

I am attaching the logs after setting config showLogs as true. Also the postman response which we get in case of which we want to consider it as a Success Response is as below:

AS5278_0-1699307808891.png

Thanks.

 

xurde

SB
Saviynt Employee
Saviynt Employee

Can you try with below. If it does not work, share the complete JSON.

"successResponse": ["A record with this combination of values already exists."],
        "successResponsePath": "",

 


Regards,
Sahil