Authentication Using Tokens

Welcome! Here you will have access to all the resources necessary to build an application successfully.

At its core, Servetel 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 Servetel 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.servetel.in/v1/auth/login \
   --header 'accept: application/json' \
   --header 'content-type: application/json'
  --data '{"email":"[email protected]","password":"password"}'    

You can retrieve the access token by entering the below-mentioned values in the Request Variables:

VariableDescriptionData Type
emailThe login ID of the client.String
passwordThe 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:

VariablesDescriptionData Type
successThe token generate status.Boolean
access_tokenThe generated access token. Copy this code and use it in all your APIs which ask for authorization.String
token_typeThe type of the token generated.String
expires_inThe time for which the token is valid.Number

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.servetel.in/v1/auth/refresh \
     --header 'accept: application/json'
     --header 'Authorization: yourtokengoeshere'