Skip to main content

Authentication

To invoke a Symbl API call, you must have a valid Access Token generated using the valid application credentials. If you don't already have your app id or app secret, log in to the platform to get your credentials.

In this example we use the following variables which you must replace in the code examples for the code to work:

KeyDescription
APP_IDThe application ID you get from the Symbl Platform.
APP_SECRETThe application secret you get from the Symbl Platform.

Code Example#

You can view the cURL, Node.js and Python code to generate the Access Token. The Node.js code should work with Node.js 7+ and browsers. You will need to install the request library for the Node.js sample code:

curl -k -X POST "https://api.symbl.ai/oauth2/token:generate" \
-H "accept: application/json" \
-H "Content-Type: application/json" \
-d $'{
"type" : "application",
"appId": "'$APP_ID'",
"appSecret": "'$APP_SECRET'"
}'

For a valid APP_ID and APP_SECRET combination, the success response will be returned like this.

{
"accessToken": "your_accessToken",
"expiresIn": 3600
}

accessToken - Token to be used for authorization in the Authorization header. expiresIn - Duration in seconds after which the accessToken expires.

For any invalid appId and appSecret combination, the HTTP 401 Unauthorized response code will be returned.