Zapier recognizes that temporary unavailability is sometimes inevitable for your API.
afterResponse
middleware and throw a ThrottledError
like this:
Note: You need to setskipThrowForStatus
totrue
when invokingz.request()
.
Note: Integrations built with the Zapier Platform UI can enable the skipThrowForStatus toggle under Advanced/Settings to On to use skipThrowForStatus:true
on every request
ThrottledError(message,delay)
method accepts two input parameters; a custom error message (string) and a delay expressed in seconds (integer).
Include a Retry-After header with responses provided by your API during downtime, to specify the amount of time until the service is expected to be back online and Zapier should retry the request. Your custom error handling script can read this header and pass it to the delay parameter for ThrottledError()
, like this: