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

AS5278
New Contributor III
New Contributor III

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
1 REPLY 1

sahil
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