We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics

API calls using <data> tag - Capture 500s/404s errors

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
vikas
Posts: 53
Joined: Wed May 13, 2015 7:46 pm

API calls using <data> tag - Capture 500s/404s errors

Post by vikas »

Hi Plum

We are trying to find if we can capture the response body and response headers in case of 500s/400s errors when using <data> tag for invoking REST APIs.

We know that Plum throws badfetch exception for 500s/400s errors and are handling these exceptions using the catch block as shown below
<catch event="error.badfetch.https.415 error.badfetch.http.415">

However we don't know how to extract response body and response headers in case of 500s/400s.
Kindly let us know. Thanks.

Thanks & Regards
Vikas Prasad

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

Re: API calls using <data> tag - Capture 500s/404s errors

Post by support »

Hi Vikas,

Unfortunately, at this time the response data is not available when the server returns a 4xx response. The reason for this is that VoiceXML standard states that the <data> tag variable will not be set if a non-2xx response is received from the server. Instead we are required to throw an error.badfetch.http.409 and leave the named <data> tag variable unset. We only provide the response data to the application for 2XX response response codes. For 4XX and 5XX response codes the response data is not available.

If this is a requirement for your team you should reach out to your account manager at Plum who can work with the platform engineers to determine if there is a way to support this requirement.

Regards,
Plum Support

Post Reply