Click HERE to see how Saviynt Intelligence is transforming the industry. |
08/30/2023 02:49 PM - edited 08/30/2023 02:52 PM
Hi Team,
am doing a writeback to a target application using user update json. The isssue i see is irrespective of success or failure task is getting completed and in logs i can see that the api returned 400 response. I tried unsucessResponse json but its not working. Is there any limitation with update user json?
PFA
{
"actions": {
"Update Login": {
"call": [
{
"name": "call1",
"connection": "acctAuth",
"callOrder": 0,
"url": "https://zendesk.co/hr/v1/email.change",
"httpMethod": "POST",
"httpContentType": "application/json",
"httpParams": "{\"events\":[{\"data\":{\"transform\":{\"worker\":{\"id\":{\"email\":{\"emailUri\":\"1234@dfs.com\"}}}}}}]}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"unsuccessResponses": {
"statusCode": [
null,
400,
401,
403,
404,
405,
409
]
}
}
]
}
}
}
Logs:
2023-08-30T19:38:13.773106538Z stdout F 2023-08-30 19:38:13,773 [quartzScheduler_Worker-1] DEBUG rest.RestUtilService - pullObjectsByRest - responseStatusCode ::400
09/01/2023 07:26 AM
Hi @iam01
If you make the Api call from postman is it working fine giving 200 success response.
Thanks
Darshan
09/01/2023 07:59 AM
The problem/ QQ was, when the API returns 400 as a response, I want the task to fail. Currently, however, regardless of the API response code, the task is marked as completed.
09/01/2023 08:32 AM
Hi @iam01
Can you please add this as well in the update user json
"successResponsePath": "responseText".
You can get the path from the postman when Api is failed or you can get it from this config showlogs=true in config json param in connection level and check the logs.
Also would suggest you to remove unsuccessResponses and keep only success response so that any other response system will treat it as unsuccess.
Thanks
Darshan
09/01/2023 09:41 AM
Thanks Darshan, i will test and update shortly. @Darshanjain QQ, i could not find much about "configJson" in rest documentation, Could you please share any link where i can go through configJson.
Am refering below link:
https://docs.saviyntcloud.com/bundle/REST-v23x/page/Content/Developers-Handbook.htm
09/01/2023 09:43 AM
Here you go-
Thanks
Darshan
09/01/2023 10:05 AM
@Darshanjain after adding that showlogs, i didnt see signfincat differnece in logging however,below is the api response from postman.
{
"events": [
{
"eventStatusCode": {
"codeValue": "complete",
"shortName": "complete"
},
"data": {
"eventContext": {
"worker": {
"id": "d56356563"
}
},
"output": {
"worker": {
"businessCommunication": {
"email": {
"emailUri": "asdfds@dfre.com"
}
}
}
}
}
}
]
}
09/04/2023 03:59 AM
Hi @iam01
In logging you should be able to the success response path, As per postman it is a blank one so you can put the below and try it out.
"successResponsePath": "responseText".
Thanks
Darshan
09/05/2023 01:39 PM
09/07/2023 06:02 AM
Yes it worked.
09/05/2023 07:06 AM
09/05/2023 07:08 AM
LOGS:
responseText:{confirmMessage":{"confirmMessageID":{"idValue":"D90C-B55C5E04816F"
2023-09-05T14:01:17.476421845Z stdout F 2023-09-05 14:01:17,476 [quartzScheduler_Worker-5] DEBUG rest.RestUtilService - pullObjectsByRest - responseStatusCode ::400