GET tickets/{id}

Overview

The Tickets API provides status information for all asynchronous API calls. You can use the GET /v2/tickets/{id} call to retrieve the specified ticket object. A request will go through many states as it is processed. These states are all recorded in the events array and the current state is in the state object. There are four possible states, accepted is the first state and should always be the state in the initial response. Next is the processing state which can have several entries as the request is moving through processes. The request may also go into a retrying state if the initial processing attempt failed. The final state is either completed or failed. If the request fails then there will be an error message indicating the cause of failure. Tickets are only available for 4 days. They should be checked immediately following any asynchronous request until a final disposition is reached.

Retry

If subscriber service is unavailable, then the message will immediately go into retrying state and the retry queue. 30 seconds later the request will be retried. If it fails then status is updated and back into the retry queue for 60 seconds. This will continue for a total of 19.5 minutes. After that time the message will fail and the process will end.

  • 30000 ms (30 seconds)
  • 60000 ms (60 seconds)
  • 180000 ms (2.5 minutes)
  • 300000 ms (5 minutes)
  • 600000 ms (10 minutes)

Resource URI

 https://api.yesmail.com/v2/tickets/{id}

Call Description

The GET tickets/{id} call retrieve data associated with the specified range ticket object.

HTTP Return Codes

Code

Description

200 OK

The request has succeeded.

401 Unauthorized

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

404 Not Found

The server has not found anything matching the request resource.  The Id does not exist. Tickets are retained for 24 hours.

Response

File import goes through several processing steps before it is completed.

{
    "state": "completed",
    "message": "finished importing job",
    "request": {
        "id": null,
        "user": "jefftronics3",
        "time": "2015-09-01T19:29:05.000Z",
        "uri": "https://api.test.yesmail.com/v2/subscribers/file-import"
    },
    "events": [
        {
            "state": "accepted",
            "message": "Accepted",
            "time": "2015-09-01T19:29:05.572Z"
        },
        {
            "state": "processing",
            "message": "Downloading file from source ftp://54.83.203.200/subscriber_import.csv",
            "time": "2015-09-01T19:29:05.668Z"
        },
        {
            "state": "processing",
            "message": "File from source ftp://54.83.203.200/subscriber_import.csv Downloaded. File is to be imported",
            "time": "2015-09-01T19:29:06.225Z"
        },
        {
            "state": "processing",
            "message": " start importing job ....",
            "time": "2015-09-01T19:29:06.299Z"
        },
        {
            "state": "processing",
            "message": "Async Results resource created",
            "time": "2015-09-01T19:29:06.667Z"
        },
        {
            "state": "completed",
            "message": "finished importing job",
            "time": "2015-09-01T19:29:14.444Z"
        }
    ],
    "lastUpdate": "2015-09-01T19:29:14.444Z",
    "id": "55e5fc8170f4f75a19005207",
    "response": {
        "location": "https://api.test.yesmail.com/v2/async-results/55e5fc82e4b0bc8fc0c311fd"
    }
}

Response

Not an actual response, but rather description of response values.

{
    "id": "ticket id",
    "state": "accepted | processing | retrying | completed | failed",
    "message": "Current status description for humans",
    "lastUpdate": "UTC based timestamp when ticket was created",
    "events": [
        {
            "state": "accepted | processing | retrying | completed | failed",
            "message": "Status description for humans",
            "time": "UTC based timestamp when ticket was created"
        },
        {
            "state": "processing|retrying|completed|failed",
            "message": "Status description for humans",
            "time": "UTC based timestamp when ticket was updated"
        }
    ],
    "request": {
        "id": "<UUID tracking ID>",
        "user": "API-User header value from the request",
        "time": "UTC based timestamp when the request was received",
        "uri": "Request URI used by the caller"
    },
    "response": {													;optional collection
        "uri": "Optional URI to POST to when status reached completed or failed",
        "ref": "Optional reference value provided by the caller",
        "time": "Optional completed time reported by executing service",
        "code": "Optional HTTP status code for the request",
        "location": "Optional URI to the resource that was created/updated",
        "data": "Optional, only provided for some calls (insert/update/bulkprocess/search)"
    }
}