Authenticate

Each request you send to the Symbl.ai APIs requires an access token in the header. Access tokens are JWT tokens that you generate when you authenticate with the Symbl.ai APIs. Access tokens expire 24 hours after being generated.

This guide provides examples of how to authenticate and get your access token. To use the code samples throughout the docs, you will need to provide an access token.

For more information about signing up and using Symbl.ai, see the Get Started Guide.

This topic provides examples using curl, JavaScript, and Python. We also provide this request in our API Reference.


Generate an access token

To authenticate, you must have your Symbl.ai app ID and secret from the Symbl.ai Platform.

To generate an access token:

👍

Try our interactive examples!

We provide interactive versions of these code samples: curl, Node.js, Python

To get started with our code samples, see Set Up Your Test Environment.

APP_ID="<APP_ID>"
APP_SECRET="<APP_SECRET>"

curl \
  --url https://api.symbl.ai/oauth2/token:generate \
  --header 'Content-Type: application/json' \
  --data '{
    "type": "application",
    "appId": "'"$APP_ID"'",
    "appSecret": "'"$APP_SECRET"'"
}'
import fetch from 'node-fetch';

const appId = '<APP_ID>';
const appSecret = '<APP_SECRET>';

const fetchResponse = await fetch('https://api.symbl.ai/oauth2/token:generate', {
  method: 'post',
  headers: {
    'Content-Type': "application/json",
  },
  body: JSON.stringify({
    type: 'application',
    appId: appId,
    appSecret: appSecret
  })
});

const responseBody = await fetchResponse.json();

console.log(responseBody);
import requests

app_id = "<APP_ID>"
app_secret = "<APP_SECRET>"

url = "https://api.symbl.ai/oauth2/token:generate"

headers = {
  "Content-Type": "application/json"
}

request_body = {
  "type": "application",
  "appId": app_id,
  "appSecret": app_secret
}

response = requests.post(url, headers=headers, json=request_body)

print(response.json())

Where: