Minh_Au | 2021-09-15 05:31:20 UTC | #1
I am trying to create a few Data Actions to an external Web Service, but am receiving 400 errors most of the time. Occasionally, the Test function succeeds (usually after not touching/testing it for several hours), but then fails immediately afterwards with the exact same information. I have tested using Postman and the Web service call completes successfully everytime via Postman, but only rarely succeeds in Genesys Cloud.
Here is the successful test case via Genesys Cloud
- Validate request body contains simple json (key-value pairs)
{ "integrationId": "5a1e253a-d15b-4323-a882-ebe90ee509e3", "rawRequest": "{\"Phone\":\"0399999999\"}", "Phone": "0399999999", "orgId": "d33a9820-c13c-49d6-8ae9-04dd87325eb1" }
- Validate request body against simple input schema
{ "success": true }
- Perform authentication
{ "success": true }
- Resolve request URL template
"[POST] https://xxxxxxxxxxxxxx"
- Resolve request header templates
{ "Authorization": [ "<REDACTED>" ], "Content-Type": [ "application/json" ] }
- Resolve request body template
"{\"Phone\":\"0399999999\"}"
- Execute
{ "AvailableForCancel": true, "CancelToken": "DdBHz/+mkxQQpYNLfoR+6PqAkds=" }
- Resolve translation map
{ "rawResult": "{\n \"AvailableForCancel\" : true,\n \"CancelToken\" : \"DdBHz/+mkxQQpYNLfoR+6PqAkds=\"\n}" }
- Apply output transformation
{ "AvailableForCancel": true, "CancelToken": "DdBHz/+mkxQQpYNLfoR+6PqAkds=" }
- Validate output against schema
{ "success": true }
- Flatten
{ "CancelToken": "DdBHz/+mkxQQpYNLfoR+6PqAkds=", "AvailableForCancel": true }
This is a call immediately following where it failed:
- Validate request body contains simple json (key-value pairs)
{ "integrationId": "5a1e253a-d15b-4323-a882-ebe90ee509e3", "rawRequest": "{\"Phone\":\"0399999999\"}", "Phone": "0399999999", "orgId": "d33a9820-c13c-49d6-8ae9-04dd87325eb1" }
- Validate request body against simple input schema
{ "success": true }
- Perform authentication
{ "success": true }
- Resolve request URL template
"[POST] https://xxxxxxxxxxxxxxxxxxxx"
- Resolve request header templates
{ "Authorization": [ "<REDACTED>" ], "Content-Type": [ "application/json" ] }
- Resolve request body template
"{\"Phone\":\"0399999999\"}"
- Execute
{ "message": "The request could not be understood by the server due to malformed syntax.", "code": "bad.request", "status": 400, "messageParams": {}, "contextId": "b4fe4f1f-3204-4d6f-bfb6-09ce00d8b90a", "details": [ { "errorCode": "ACTION.REMOTEENDPOINT" } ], "errors": [ { "message": "REST call for action execute failed. Message:Request to backend service failed. Response from web service: [b4fe4f1f-3204-4d6f-bfb6-09ce00d8b90a]", "code": "BADREQUEST", "status": 400, "messageParams": {}, "details": [], "errors": [] } ] }
The web service provider is telling me that on the subsequent attempts, Genesys Cloud is not sending any data in the request body and that it is "null". Their logs suggest no data exists.
Regards,
Minh
Jason_Mathison | 2021-09-15 23:20:34 UTC | #2
Hi Minh_Au,
I would start with the "web services" tab on this page. Item #1 on that list will often resolve odd problems.
https://help.mypurecloud.com/articles/troubleshoot-the-data-actions-integrations/
--Jason
Minh_Au | 2021-09-15 23:20:28 UTC | #3
Hi Jason,
Thank you for pointing me to that resource article. I had stumbled upon it a little bit before you posted and found the suggestion to use Transfer-Encoding : buffered instead of the default Transfer-Encoding : chunked. That fixed it!
Not sure why it worked sometimes, but failed most of the time, but it helped.
Thanks for the assist though.
Regards,
Minh
system | 2021-10-16 23:21:27 UTC | #4
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 12008