GET async-results/{id}

Overview

The Async Results API is used to get the status of an invidual asynchronous request at the record level. 

Resource URI

 https://api.yesmail.com/v2/async-results/{id}

Call Description

The GET /v2/async-results/{id} call returns statistics and details for an asynchronous request involving multiple records. The response includes a counts section with totals for completed, failed, ignored, total (completed&failed), and requested. Requested value is only shown if greater than zero. After the counts section are the results for each request results classification. These arrays all contain an index, which matches the record based on its original request order. The index starts at zero, so the first record in a request would coorespond to an index value of zero. The completed array includes a time stamp and a location for the successful result. The failed array contains a time stamp and an error associcated with the request. The ignored array only contains a list of index values.

URI Parameters

Parameter

Requirement

Description

failed

Optional

Controls whether the "failed" array is included in the response. By default "failed" is included (parameter value is true), the caller must include "failed=false" to exclude from the response.

completed

Optional

Controls whether the "completed" array is included in the response. By default "completed" is not included (parameter value is false), the caller must include "completed=true" to include in the response.

ignored

Optional

Controls whether the "ignored" array is included in the response. By default "ignored" is not included (parameter value is false), the caller must include "ignored=true" to include in the response.

first

Optional

Parameter indicating the lowest index value to include in the response. Must be zero or higher (up to maximum of unsigned 32-bit Integer). Index can be in either "failed" or "completed" array.

last

Optional

Parameter indicating the highest index value to include in the response. Must be zero or higher (up to maximum of unsigned 32-bit Integer). Index can be in either "failed" or "completed" array.

HTTP Return Codes

 

Code

Description

200 OK

The request has succeeded.

400 Bad Request

An invalid parameter was used, or an invalid parameter value was used. The error message will specify the exact problem.

401 Unauthorized

The request requires user authentication.  Invalid Api-User and/or Api-Key header value.

404 Not Found

The async-results resource could not be found

Response Payload: 
{
  "id": "9876543210",
  "lastUpdate": "2014-02-11T16:08:32Z",
  "counts": {
    "completed": 1,
    "failed": 1,
    "ignored": 1,
    "total": 2,
    "requested": 3
  }
  "completed ": [
    {
      "index": 0,
      "time": "2014-02-11T16:08:22Z",
      "location": "https://api.yesmail.com/v2/subscribers/name%40domain.com"
    }
  ],
  "failed": [
    {
      "index": 1,
      "time": "2014-02-11T16:08:32Z",
      "error": {
        "status": 409,
        "message": "Conflict while inserting a subscriber",
        "moreInfo": "https://developer.yesmail.com/errors/subscriber-insert-conflict"
      }
    }
  ],
  "ignored": [
    { "index": 2 }
  ]
}