POST /pylon/{service}/task

Submit a PYLON analysis task or Media Strategies API task.

An HTTPS POST request sent to:

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

A successful call to this endpoint returns: 202 Accepted plus a JSON object.

Parameters

Parameter Description
service
required

The service to which the task relates.

Example value: linkedin

subscription_id
required

The id of the recording you want the task to run against.

Example value: f8dde04774540ac119c2317a4d15a8b3a1350939

name
required

A human-readable name for the task.

Example value: Top articles in the US

type
required

The type of task to run.

  • analysis - for PYLON analysis tasks.
  • strategy - for Media Strategies API tasks.
parameters
required

The parameters for the task to run - see below.

Task parameters

The parameters you provide depend on they type of task you are submitting.

Parameters for PYLON analysis tasks are described on the Analysis Task Parameters page.

Parameters for Media Strategy API tasks depend on the strategy being run. Parameters are described on each Strategy Documentation page.

Examples

  1. Create a PYLON analysis task

    This set of parameters will create a time series analysis task that breaks volume down into hourly buckets.

    {
        "name": "Time series analysis 1",
        "type": "analysis",
        "subscription_id": "e9dde04774540ac119c2317a4d15a8b3a1350937",
        "parameters": {
          "parameters": {
            "analysis_type": "timeSeries",
            "parameters": {
              "interval": "hour",
              "span": 1
            }
          }
        }
      }

  2. Create a Media Strategies API task

    This set of parameters will create a top_urls strategy task which analyzes the top pieces of content for the topic of 'cloud'.

    {
        "type": "strategy",
        "name": "example",
        "subscription_id": "e9dde04774540ac119c2317a4d15a8b3a1350937",
        "parameters": {
          "strategy": "top_urls",
          "version": 1,
          "parameters": {
            "keywords": {
              "any": ["cloud", "azure", "aws", "google cloud", "vmware"]
            },
            "comparison_audience": "global"
          }
        }
      }

Further examples of analysis tasks can be found on the Analysis Task Parameters page.

Further examples of Media Strategy API tasks can be found on the relevant Strategy Documentation page.

Output

If the task is accepted for processing the id of the new task is provided in the output:

{
    "id": "f3756f8de519cbd7449b8780e7eaffd407eb7f00"
}

Responses

Response code Description
Status 202 Accepted

On success the response provides the task id you need to use to track progress of the task and retrieve analysis results.

{
    "id": "{task id}"
}
Status 400 Bad Request

One or more of the passed parameters is invalid, or a required parameter is not present.

{
    "error": "{error message}"
}
Status 404 Not Found

The recording you specified using subscription_id was not found.

{
    "error": "Subscription not found"
}

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.5.

Resource information

Rate limit cost: 25

Requires authentication: Yes

Response formats: JSON, JSONP