This page explains how our API handles authentication. Note that all of our client libraries handle authentication for you, so we recommend you use these for your solution when possible.
The DataSift platform provides two types of API:
- REST API
- Streaming API
How you provide your authentication details differs between each.
REST API Authentication
To access REST API endpoints (regardless of HTTP method), you need to provide an
For example to call the /account/usage endpoint:
curl -X GET https://api.datasift.com/v1.4/account/usage?period=hourly \ -H 'Authorization: username:api_key'
API Keys and Account Identities
If you are making API calls to a PYLON API endpoint, you will need to use an Account Identity API Key. You can ready more about this in our Managing Identities guide
All other API calls should be make with your core API key, found at app.datasift.com/settings.
You will receive an HTTP 403 error message, and a relevant error message should you try to use the wrong type of API key in an API call.
Streaming API Authentication
When accessing the streaming API (using the Websocket protocol), rather than using an Authorization header you instead pass your authentication details in the query string instead.
Threfore the URI format is: