GET /account/identity/{identity_id}/token

List all the tokens for a given Identity.

To learn how to use the endpoints together take a look at our account API step-by-step page

An HTTPS GET request sent to:

https://api.datasift.com/v1.3/account/identity/{identity_id}/token

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

Parameters

Parameter Description
per_page
optional

Number of results to return per page.

Default: 25

page
optional

The page you want to retrieve. For example, if you set this parameter to 3, the API will return page 3 only (if there is sufficient data to fill more than 2 pages).

Default: 1

Examples

  1. Retrieve details of all tokens for a given identity. The per_page parameter is set to 50 entries per page. The page parameter is not specified either so it will default to 1. If there are more than 50 results, the remainder will not be returned. To see them, you will need to make further calls to this endpoint. The count element shows the total number of results available:

    curl -X GET https://api.datasift.com/v1.3/account/identity/1234567890abcdef1234567890abcdef/token?per_page=50 
      -H 'Authorization: username:api_key'

    The JSON output looks like this:

    HTTP/1.1 200 OK
    
      {
          "count": 2,
          "tokens": [
              {
                  "service": "facebook",
                  "token": "<token>",
                  "created_at": <timestamp>,
                  "updated_at": <timestamp>,
                  "expires_at": <timestamp>
              },
              {
                  "service": "facebook",
                  "token": "<token>",
                  "created_at": <timestamp>,
                  "updated_at": <timestamp>,
                  "expires_at": <timestamp>
              }
          ]
      }

  2. Retrieve details of all tokens for a given identity used with Facebook:

    curl -X GET https://api.datasift.com/v1.3/account/identity/1234567890abcdef1234567890abcdef/token/facebook?per_page=50 
      -H 'Authorization: username:api_key'

Output Fields

Property Type Description
service string The name of the service you specified in your call to this endpoint.
token string The token for the service you requested.
created_at int Unix timestamp.
updated_at int Unix timestamp.
expires_at int Unix timestamp. Can be null.

Responses

Response code Description
Status 404 Not Found

Occurs if you use a label that does not already exist.

{ "error": "An Identity with the supplied id was not found" }

Status 410 Gone

Occurs if the identity has been deleted already.

{
  "error": "The Identity with the supplied id has been deleted"
}

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

Resource information

Rate limit cost: 5

Requires authentication: Yes

Response formats: JSON, JSONP