chengcheng | 2022-03-09 03:08:22 UTC | #1
I know that contract is not support for Nested Objects. so I added Nested Objects in con configuration -> Request Body Template, but it still not work well.
what I want to do is that add below Json to body when request web service, I wrote below to configuration -> Request Body Template, but it not work. { "menu": { "type": "${input.type}", "id": "${input.id}", "password": "${input.password}" }, "name": "${input.name}" } }
the error message was : { "message": "The request could not be understood by the server due to malformed syntax.", "code": "bad.request", "status": 400, "messageParams": {}, "contextId": "4f3b13e6-3e1e-457b-93db-74a1bb95c082", "details": [ { "errorCode": "ACTION.REMOTEENDPOINT" } ], "errors": [ { "message": "REST call for action execute failed. Message: Request to backend service failed. Response from web service: \n { \"moreInfo\" : { \"code\" : \"400.01.001\", \"developerMessage\": [\"ExecutionFailed\", \"\"], \"userMessage\" : \"Invalid request data or missing mandatory parameters\", \"moreInfo\" : \"\" }}\n [4f3b13e6-3e1e-457b-93db-74a1bb95c082]", "code": "BADREQUEST", "status": 400, "messageParams": {}, "details": [], "errors": [] } ] }
please help.
Jason_Mathison | 2022-03-09 12:43:06 UTC | #2
Hi,
The approach that you took to take the flat input schema and put it into a complex request body is correct.
The error that is coming back from the endpoint that you are trying to use is not very specific about the problem:
{ "moreInfo" : { "code" : "400.01.001", "developerMessage": ["ExecutionFailed", ""], "userMessage" : "Invalid request data or missing mandatory parameters", "moreInfo" : "" }
Are you able to us this endpoint in a tool like postman? It is a lot easier to figure out the API with a tool like that and then move on to a data action once you know exactly what you want to do.
One other possibility is that your endpoint doesn't like the transfer-encoding that data actions use by default. See https://help.mypurecloud.com/articles/troubleshoot-the-data-actions-integrations/ web services tab -> Custom action fails for unexpected reason
--Jason
chengcheng | 2022-03-10 00:36:28 UTC | #3
Hi Jason
thank you for your reply. yes. I do test it using postman before implement it data action, postman return the response correctly.
I tried enter "Transfer-Encoding : buffered" in the header of request as your mentioned, but the error is the same, still struggle on how to solve this issue.
Regards, Chengcheng
Jason_Mathison | 2022-03-10 14:41:13 UTC | #4
Hi Chengcheng,
Can you ask the owner of the web service that you are using what the problem is with your request? The error message didn't provide much detail.
Otherwise I don't know what to tell you other than to look at each step of the test mode output, comparing the headers, URL, and request body to what you have working in postman.
--Jason
chengcheng | 2022-03-14 02:27:12 UTC | #5
Hi Jason
thank you, we found that the parameter in request was wrong, solved it after modified the parameter.
Regards, Chengcheng
system | 2022-04-14 02:27:23 UTC | #6
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: 13846