GET /account/identity/{identity_id}/token/{service}

Retrieve the token for a given Identity for a given service.

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.5/account/identity/{identity_id}/token/{service}

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

Examples

  1. Retrieve token details of an account identity for Facebook:

    curl -X GET https://api.datasift.com/v1.5/account/identity/ba80c64a826293e57fc809b76347716f/token/facebook \
      -H 'Authorization: username:api_key'

    The JSON output looks like this:

    HTTP/1.1 200 OK
    
      {
          "service": "facebook",
          "token": "<token>",
          "created_at": <timestamp>,
          "updated_at": <timestamp>,
          "expires_at": <timestamp>
      }

  2. Retrieve token details of an account identity for LinkedIn:

    curl -X GET https://api.datasift.com/v1.5/account/identity/ba80c64a826293e57fc809b76347716f/token/linkedin \
      -H 'Authorization: username:api_key'

    The JSON output looks like this:

    HTTP/1.1 200 OK
    
      {
          "service": "linkedin",
          "token": null,
          "created_at": <timestamp>,
          "updated_at": <timestamp>,
          "expires_at": <timestamp>
      }

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. Can be null.
created_at int Unix timestamp.
updated_at int Unix timestamp.
expires_at int Unix timestamp. Can be null.

Responses

Response code Description
Status 200 OK The call was successful.
Status 404 Not Found
{
  "error": "An Identity with the supplied id was not found"
}

{
  "error": "A token for <service> was not found for the Identity"
}
Status 410 Gone

Occurs if the identity has been deleted.

{
  "error": "An 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.5.

Resource information

Rate limit cost: 5

Requires authentication: Yes

Response formats: JSON, JSONP