Welcome! Here you will have access to all the resources necessary to build an application successfully.
At its core, Tata Cloud Telephony uses JWTs to provide RESTful access to its resources.
Here are some specific resources and guides to get you started in a jiffy!
About Access Tokens
- Permanent Access Token: You need to contact Tata cloud telephony support for unlimited access token.
- Short-Lived Token: Herein, you can access a 1-hour valid token using server-side JWT assertion.
Note: The token does not contain any information about the user and only contains authorization information for running an API.
Requesting a Token
You can request the token in the following manner:
curl --request POST \
--url https://api-smartflo.tatateleservices.com/v1/auth/login \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{"email":"[email protected]","password":"password"}'
The below video illustrates the token fetching mechanism to get a short-lived token.
Let's understand the Request and Response Variables in detail.
Request Variables (Body Params)
You can retrieve the access token by entering the below-mentioned values in the Request Variables:
Variable | Description | Data Type |
---|---|---|
The login ID of the client. | String | |
password | The password of the client. | String |
Response Variables
When the Request Variables are parsed, you will get Response Variables in return. They will contain the unique access token which can be used for running an API.
The response variables are as following:
Variables | Description | Data Type |
---|---|---|
success | The token generate status. | Boolean |
access_token | The generated access token. Copy this code and use it in all your APIs which ask for authorization. | String |
token_type | The type of the token generated. | String |
expires_in | The time for which the token is valid. | Number |
Using the API Token
Once you have the access token, refer to the video to learn how to run an API using the token.
Refreshing a Token
The short-lived tokens have a lifetime of 60 minutes, after which you will have to request a refresh token, like in the example shown below.
curl --request POST \
--url https://api-smartflo.tatateleservices.com/v1/auth/refresh \
--header 'Accept: application/json' \
--header 'Authorization: yourtokengoeshere'