Oktay_Kemal | 2022-10-18 21:31:43 UTC | #1
Hi,
I have a REST service where successful requests work fine however the failed ones display the error below.
{ "message": "The requested resource was not found.", "code": "not.found", "status": 404, "messageParams": {}, "contextId": "ba56ed50-87d2-477d-8fc3-032875e7784a", "details": [ { "errorCode": "ACTION.REMOTEENDPOINT" } ], "errors": [ { "message": "REST call for action execute failed. Message: Request to backend service failed. Response from web service: {\"success\":false,\"code\":\"user.notfound\",\"message\":\"User Not Found\",\"errors\":[],\"tracker\":\"fba534a2-edf9-4e32-b30c-ec5532135030\"} [ba56ed50-87d2-477d-8fc3-032875e7784a]", "code": "NOT_FOUND", "status": 404, "messageParams": {}, "details": [], "errors": [] } ] }
On the postman I am getting the following output for the same account query:
{ "success": false, "code": "user.not_found", "message": "User Not Found", "errors": [], "tracker": "decdd3f0-1d24-4b77-83a4-sa6d560cf683" }
Is there a way to parse a failed REST response? I want to get these responses as variables in an Architect flow for setting proper actions.
Thanks, Oktay
Hampus_Nygren | 2022-10-20 06:33:55 UTC | #2
Hi,
In common modules you have both Success Outputs as well as Failure Outputs, I dont know why it isnt available in Flows.
Jason_Mathison | 2022-10-20 20:59:28 UTC | #3
Your options are pretty limited here. The endpoint is returning a 404, which means that the data action will take the failure path. If your architect flow is a call IVR, then no additional information will be returned in the failure path. For other types of flows you may have some or all of that response available to you.
If you really want to make sure to have the response then you would need to have an intermediary web service or lambda to call the 3rd party endpoint and return a successful response, even if the 4rd party endpoint returned a failure code.
Another thing you can do is submit an idea to https://genesyscloud.ideas.aha.io/ideas While this will not immediately resolve your issue, it will let product management know about this issue.
--Jason
Oktay_Kemal | 2022-10-21 07:42:25 UTC | #4
Hi Jason,
Thanks for your input.
Well, yes, it is an Inbound Call Flow. I'll see if we could have this web service modified or maybe create an intermediary web service. But I guess that it would be nice to have the ability to retrieve the variables form a failed REST response. I will post it as an idea.
Thanks again, Oktay
Brad_Murlin | 2022-10-27 16:15:56 UTC | #5
I second what @Hampus_Nygren said - use a Common Module, which is like a mini-architect flow that runs inside another flow - and specifically allows you to bring back variable data from failed data actions.
The setup would be: inbound Call Flow>tiny detour into Common Module for this data action>back to Inbound flow to finish processing. The caller will never know.
Jason_Mathison | 2022-10-27 18:39:03 UTC | #6
Hi All,
The challenge is that when you are running a flow for a phone call the failure details currently don't make it back to the flow. You can vote for this idea as well as adding any additional use cases here: https://genesyscloud.ideas.aha.io/ideas/INB-I-1498
--Jason
system | 2022-11-27 18:39:44 UTC | #7
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: 16770