Guides
Authentication
How to generate a bearer token and the required headers for API requests.
Requests are authenticated using a bearer token. Generating one is a two-step process:
- Create an Auth Client in the Hive Streaming Portal to obtain a client ID and client secret.
- Exchange those credentials for a bearer token.
Create an Auth Client
Auth Clients are managed in the Hive Streaming Portal. You need to be logged in as a user with the API Key management role.
Click Add client and select the INA Data API resource. Copy the client secret right, it's only shown until the page reloads.
Learn more about creating an Auth Client.
Generate a bearer token
Use the client ID and client secret to request a token:
curl -X POST "https://id.hivestreaming.com/v2/auth/token" \
-H "Content-Type: application/json" \
-d '{
"grant_type": "client_credentials",
"client_id": "$IDA_CLIENT_ID",
"client_secret": "$IDA_CLIENT_SECRET"
}'The response contains the bearer token. Tokens are valid for 3 hours, after which you can request a new one programmatically.
{
"token_type": "bearer",
"expires_in": 10800,
"access_token": "<token value>"
}Required headers
| Header | Required | Value |
|---|---|---|
Authorization | Yes | Bearer $IDA_BEARER_TOKEN |
platform-id | Yes | Your platform identifier |
tenant-id | Yes | Your tenant identifier |
curl "https://data-api.hivestreaming.com/ina/v1/events/sessions" \
-H "Authorization: Bearer $IDA_BEARER_TOKEN" \
-H "platform-id: $IDA_PLATFORM_ID" \
-H "tenant-id: $IDA_TENANT_ID"