Api reference MessageFlow
  • Welcome
  • Introduction
  • Authentication
  • REST clients samples
  • Long running actions - Retry-After header explained
  • Input compression
  • Using filters
  • Dynamic e-mail content
  • SMS Billing
  • Incoming webhooks
    • Steps to configure webhooks
    • Step 1: Identify the events to monitor
    • Step 2: Create a webhook endpoint
    • Step 3: Handle requests
    • Step 4: Test that your webhook
    • Step 4: Test your webhook
    • Step 5: Save your webhook configuration
  • External resources
  • Current Version
  • License
  • Groups
  • Contacts
  • Emails
  • Sms
  • Blacklist
  • Campaigns
  • Pushes
Powered by GitBook
On this page

Long running actions - Retry-After header explained

This API provide some actions that should be used in different way. When we have to deal with long running tasks we don't want to make client wait. To resolve this case we provided support for Retry-After header. How it works? Pretty simple:

  1. Client executes long running action (ex. POST /long-running)

  2. If response data is available then response with HTTP status 200 and data array is returned

  3. If request is not yet available API returns following response:

HTTP/1.1 202 ACCEPTED

Content-Type: application/json
Retry-After: <delay-seconds>
Expires: <http-date>

...

And here we have to explain the meaning of above response headers:

  • HTTP/1.1 202 ACCEPTED indicates that response is not yet available

  • Retry-After indicates how long client should wait before making next request to this endpoint

  • Expires contains the date/time after which the response is considered stale (client should NOT make another request to this endpoint after time specified at this header)

That all. Pretty simple. Isn't it?

PreviousREST clients samplesNextInput compression