Page 1 of 1

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

Posted: Tue May 23, 2017 11:47 am
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

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

Posted: Tue May 23, 2017 3:26 pm
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