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

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

  • Author
  • Message
Offline

vikas

  • Posts: 49
  • Joined: Wed May 13, 2015 8:46 pm

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

PostTue May 23, 2017 12:47 pm

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
Offline

support

  • Posts: 3348
  • Joined: Mon Jun 02, 2003 4:47 pm
  • Location: Boston, MA

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

PostTue May 23, 2017 4:26 pm

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

Return to Plum DEV Q&A

Who is online

Users browsing this forum: No registered users and 1 guest

cron