GET /pylon/{service}/task/{id}

Retrieve a PYLON task.

An HTTPS GET request sent to:

https://api.datasift.com/v1.4/pylon/{service}/task/{id}

A successful call to this endpoint returns: 200 OK plus a JSON object representing the task.

Parameters

Parameter Description
service
required

The service to which the task relates.

Example value: linkedin

id
required

The 40-character id of the task you want to fetch.

Example value: fb0ae04774540ac119c2317a4d15a8b3a1350939

Examples

  1. Retrieve an analysis task.

This call will return the status and result of a task for the LinkedIn Engagement Insights service:

curl -X GET https://api.datasift.com/pylon/linkedin/task/fb0ae04774540ac119c2317a4d15a8b3a1350939 \
  -H 'Authorization: username:api_key'

Output

If the task is found the returned output will be as follows.

Note that the contents of the 'result' property are the results of the task you requested.

HTTP/1.1 200 OK
{
    "id": "fb0ae04774540ac119c2317a4d15a8b3a1350939",
    "identity_id": "03a78e036afb076a6606c5195c1f9b42",
    "subscription_id": "f8dde04774540ac119c2317a4d15a8b3a1350939",
    "name": "Example query",
    "type": "analysis",
    "parameters": {
        "parameters": {
            "analysis_type": "freqDist",
            "parameters": {
                "target": "li.type",
                "threshold": 3
            }
        }
    },
    "result": {
        "interactions": 90100,
        "unique_authors": 15900,
        "analysis": {
            "analysis_type": "freqDist",
            "parameters": {
                "target": "li.activity.type",
                "threshold": 10
            },
            "results": [
                {
                    "key": "activity",
                    "interactions": 2700,
                    "unique_authors": 2400
                },
                {
                    "key": "click",
                    "interactions": 5400,
                    "unique_authors": 4200
                },
                {
                    "key": "article_view",
                    "interactions": 5400,
                    "unique_authors": 4200
                }
            ]
        }
    },
    "status": "completed",
    "created_at": 1467043573000,
    "updated_at": 1467043574000
}

The fields in the output are as follows:

Property Type Description
id string Id of the task that was fetched. A 40-character alphanumeric hash.
identity_id string The id of the identity that submitted the task.
subscription_id string The id of the index the task was run against.
name string The name the task was given when it was submitted.
type string The type of the task.
parameters object The parameters supplied when the task was submitted.
result object The result of the task. Present if the task is completed.
status string

The status of the task, one of:

  • queued - the task is waiting to be processed
  • running - the task is currently being processed
  • completed - the task has been processed
  • failed - the task failed during processing
created_at int Unix timestamp stating when the task was submitted.
updated_at int Unix timestamp stating when the task was last updated.

Responses

Response code Description
Status 200 OK The call was successful.
Status 404 Not Found

The task id you supplied was not found.

{
    "error": "The task with the id '{task id}' was not found"
}
Status 400 Bad Request Occurs if any of the parameters are malformed.

Notes

  1. All calls to the API must be properly authenticated with a DataSift username and API key.
  2. All calls to the API must be versioned. The current version is v1.4.

Resource information

Rate limit cost: 5

Requires authentication: Yes

Response formats: JSON, JSONP