These docs are for v1.0. Click to read the latest docs for v2.0.

/token

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Once a user has given approval from the /authorize endpoint, use this endpoint to receive an access_token.

Refreshing tokens

Below is a sample code for refreshing tokens.

<?php

  $client = new GuzzleHttp\Client();

  try {

    //if using Guzzle 6+ change "body" to "form_params"
    $response = $client->post('https://streamlabs.com/api/v1.0/token', [
      'body' => [
        'grant_type'    => 'authorization_code',
        'client_id'     => 'YOUR_CLIENT_ID',
        'client_secret' => 'YOUR_CLIENT_SECRET',
        'redirect_uri'  => 'YOUR_CLIENT_REDIRECT_URI',
        'code'          => $_GET['code']
      ]
    ]);

    $result = $response->json();

  } catch (Exception $e) {

    //failed
    $result = $e->getResponse()->json();

  }

?>
<?php

  $client = new GuzzleHttp\Client();

  try {

    //if using Guzzle 6+ change "body" to "form_params"
    $response = $client->post('https://www.twitchalerts.com/api/v1.0/token', [
      'body' => [
        'grant_type'    => 'refresh_token',
        'client_id'     => 'YOUR_CLIENT_ID',
        'client_secret' => 'YOUR_CLIENT_SECRET',
        'redirect_uri'  => 'YOUR_CLIENT_REDIRECT_URI',
        'refresh_token' => 'REFRESH_TOKEN_HERE'
      ]
    ]);

    $result = $response->json();

  } catch (Exception $e) {

    //failed
    $result = $e->getResponse()->json();

  }

?>
Query Params
string
required

The grant type of this request. Will be authorization_code or refresh_token depending on which is accompanying this request.

string
required

The client_id of your application.

string
required

The client_secret of your application.

string
required

The redirect_uri of your application.

string

The code received from an /authorize response. Required if grant_type is authorization_code.

string

The refresh_token received from a previous /token response. Required if grant_type is refresh_token.

Responses

Language
LoadingLoading…
Response
Choose an example:
application/json