Activity Reporting

Tasks

Provides methods for retrieving information about task resources. Tasks are long running operations – for example, when you issue a purge request, the API creates a task object for it and provides a handle to the task. Since a cache purge can take a relatively long time, you can look at currently running tasks, get the task ID and handle, and check the status of the purge request. Potentially any API request that changes something (PUT, POST, DELETE) might return a task. This will be explicit in the API's method definition.

A single task object has the following general structure. 

{
  "last_updated": "2018-03-01T21:19:41.427Z",
  "error_info": {
    "details": [
      {
        "message": "string"
      }
    ],
    "message": "string",
    "type": "string"
  },
  "end_time": "2018-03-01T21:19:41.427Z",
  "begin_time": "2018-03-01T21:19:41.427Z",
  "progress": 0,
  "id": "string",
  "complete": true,
  "uri": "string",
  "operation": "string",
  "user": {
    "id": "string",
    "uri": "string"
  },
  "status": "string",
  "target": {
    "id": "string",
    "uri": "string"
  }
}

The following table describes the contents of a task object: 

Field or block
Description
last_updated 
The UTC time at which this task was last updated.
error_info

A JSON object containing error information (in the case that the task ended with an error condition)

end_time

The UTC time at which this operation ended if it is no longer running.

begin_timeThe UTC time at which this operation began.
progressAn integer
idUnique ID for this task.
completeA boolean flag to mark the task as complete or not.
uriThe 
operationA string identifier which indicates which operation is running in this task.
userA string array containing the ID and URI of the user that initiated the task.
statusA string describing the status of the task.
targetA string array containing the ID and URI for the target of the task.

An error_info object can contain the following fields:

Field or block
Description
detailsA string array containing details of the error condition.
messageThe descriptive message provided by the error
typeString describing the type of error

GET /tasks

Returns tasks that have been updated since a given date

This method can be used to page through list of tasks that have been updated after a specified date. The specified date should be in ISO-8601 format yyyy-MM-dd'T'HH:mm:ss.SSSZ; for example, 2015-01-31T:02:25:37:455 for January 31, 2015 at approximately 2:25, with millisecond granularity.

Parameters

ParameterDescriptionParameter TypeData Type
since

The time from which tasks are desired

querystring
page

Which page in the list to return

queryinteger
count

The number of tasks to return in each page

queryinteger
status

The status of the tasks

querystring
operation

The operation that the task is tracking

querystring

Response Messages

HTTP Status CodeResponse Model
200

If a page of unread tasks was returned

400If the query parameters provided were not valid
401If authentication failed
defaultSuccess

Example requests:

GET /tasks?since=2015-02-01

GET /tasks?since=2015-02-01&count=20

GET /tasks?since=2015-02-01&count=20&page=2

GET /tasks/{task_id}

Retrieves information about a specified task.

Parameters

ParameterDescriptionParameter TypeData Type
task_id

The identifier for the task object

pathstring

Response Messages

HTTP Status CodeResponse Model
200

If the task model was returned

401If authentication failed
404If the task does not exist
defaultSuccess