push/log

Retrieve details of your Push subscriptions.

An HTTP GET request sent to:

https://api.datasift.com/v1.3/push/log

A successful call to this endpoint returns: 200 OK. You also receive a list of JSON objects.

Parameters

Parameter Description
id
optional

The id of a Subscription.
If you supply an id, the call returns details for that id only.
If you omit this parameter, the call returns details for all your Subscriptions.

Example values: 08b923395b6ce8bfa4d96f57f863a1c3

page
optional

The page number.

Example values: 42

per_page
optional
default = 20

The number of items to return per page.

Example values: 25

order_by
optional
default = request_time

The field that DataSift will use to order the results.
The only available value currently is request_time.

Example values: request_time

order_dir
optional
default = desc

The direction of the ordering.
Ascending (asc) or descending (desc).

Example values: desc

Examples

  1. Retrieve log messages for one Push subscription:

curl -X GET https://api.datasift.com/v1.3/push/log?id=d468655cfe5f93741ddcd30bb309a8c7&per_page=50&order_dir=desc&include_finished=1 
\\ -H 'Authorization:username:apikey'

{
    "success": true,
    "count": 8740,
    "log_entries": [
        {
            "request_time": 1342436365,
            "success": true,
            "subscription_id": "d468655cfe5f93741ddcd30bb309a8c7"
        },
        {
            "request_time": 1342436361,
            "success": true,
            "subscription_id": "d468655cfe5f93741ddcd30bb309a8c7"
        },
...
        {
            "request_time": 1342436255,
            "success": true,
            "subscription_id": "d468655cfe5f93741ddcd30bb309a8c7"
        }
    ]
}

  1. Here's an example of some typical errors that you might see. In this case we do not specify the id parameter so DataSift returns details of all subscriptions it finds:

curl -X GET https://api.datasift.com/v1.3/push/log?per_page=50&order_dir=desc&include_finished=1 
\\ -H 'Authorization:username:apikey'

{
    "success": true,
    "count": 8740,
    "log_entries": [
        {
            "subscription_id": "4b7ce39a5292b96ccd98f69324b0dc99",
            "success": true,
            "request_time": 1344859261,
            "message": "The delivery has completed"
        },
        {
            "subscription_id": "13ba92f6784da5e60b82f532f43c7d17",
            "success": false,
            "request_time": 1344855061,
            "message": "The delivery was paused for too long"
        },
        {
            "subscription_id": "4e097f46ef0dd2e8e3f25f84dddda775",
            "success": false,
            "request_time": 1344630221,
            "message": "Stopped due to too many failed delivery attempts"
        },
        {
            "subscription_id": "4e097f46ef0dd2e8e3f25f84dddda775",
            "success": false,
            "request_time": 1344630221,
            "message": "The endpoint returned a 500 internal server error"
        }
    ]
}

Property: Description:
count The number of entries in the log.
success Subscription state.
log_entries A list of subscription log entries as a JSON list.
request_time The time the request was made. A Unix timestamp.
success The status of the request.
subscription_id Subscription ID.
message Error message.

Notes

  1. All calls to the API must be properly authenticated with a DataSift username and API key.
  2. The /push/log API call allows you to retrieve log messages relating to a single subscription or to all your Subscriptions.
  3. For more details, take a look at the Push API overview.
  4. All calls to the API must be versioned. The current version is v1.3.

Resource information

Rate limit cost: 1

Requires authentication: Yes

Response formats: JSON, JSONP