Test Document

Insights API

The Insights Components API is a suite of endpoints that provide consolidated data views for interface components.AUTHORIZATIONBearer TokenToken

AuthenticationAUTHORIZATIONBearer TokenThis folder is using Bearer Token from collectionInsights APIPOST

Requesting tokens for API accesshttps://insights-api.alphastream.io/connect/token

All Alpha Stream API’s are protected by access tokens. To request an access token, you will need both your client_id and client_secret. If you do not have these details then please contact us.

Access tokens are issued by our identity server located at https://insights-api.alphastream.io/auth/.well-known/openid-configuration

Requesting an access token #

In order generate an accesss token you will need a client id and client secret to make the following call:

POST https://insights-api.alphastream.io/auth/connect/token
client_id=your_app_key&
client_secret=your_app_secret&
grant_type=client_credentials

Parameters: #

  • client_id (required) – This is the app key that was provided to you
  • client_secret (required) – This is the app key secret that was provided to you
  • grant_type (required) – set to client_credentials
  • scope – Each of our API’s has assigned scopes which can be added here to issuea token for a specific scope of scopes. Leave this blank to issue a token for all scopes we have explicitly assigned to your client_id (recommended)

Example(.NET): #

var client = new HttpClient();
var response = await client.RequestClientCredentialsTokenAsync(tokenRequest
{
   Address = "https://insights-api.alphastream.io/auth/connect/token",
   ClientId = "your_client_id",
   ClientSecret = "your_client_secret"
});

If the correct client_id and client_secret have been provided atoken will be issued and the following will be returned

{
    "access_token": "a7bf5b19410243b9e7d56eb7523ecc8ff464754382083221afd5f3d412c86830",
    "expires_in": 3600,
    "token_type": "Bearer"
}

Tokens stay valid until the number of seconds returned in the expires_in field in the API response. A user can go through the OAuth flow on multiple clients (browsers or devices) and simultaneously hold multiple valid access tokens as long as the same scope is requested. If the user requests a different scope than the previously granted scope, then all the previous access tokens are invalidated. It is recommneded that tokens are cached for the duraton specified in the expires_in property.AUTHORIZATIONBearer TokenThis request is using Bearer Token from collectionInsights APIBODYformdataclient_idclient_secretgrant_typeclient_credentials

Example RequestRequesting tokens for API accessView More

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://insights-api.alphastream.io/connect/token',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,

Core Resources

Here you will find details for all of the objects referenced in the API documentation.AUTHORIZATIONBearer TokenThis folder is using Bearer Token from collectionInsights API

EnumsAUTHORIZATIONBearer TokenThis folder is using Bearer Token from collectionInsights API

SortDirection Enum

SortDirection Enum #

Defines the type of sort direction.

Possible values
asc
desc

AUTHORIZATIONBearer TokenThis folder is using Bearer Token from collectionInsights API

TimePrecision Enum

TimePrecisions Enum #

Defines the type of Time Precisions.

Possible values
Minutely (m)
Hourly (h)
Weekly (w)
Daily (d)
Monthly (MM)
Quartely (q)
Yearly (y)

AUTHORIZATIONBearer TokenThis folder is using Bearer Token from collectionInsights API

Powered by BetterDocs

Scroll to Top