Get Authentication Token API

This API allows you to get the authentication token, which is used as mandatory bearer token to execute any other API. If the token is not provided all other API requests thrown the "Unauthorized" error.

URI

http://<host>/api/token?clientId=<clientId>&cs=<cs>&accountId=<accountId>&as=<as>&requesterId=<requesterId>&grant_type=<grant_type>

Variable Path Parameters

The preceding URI has the following variable path parameters:

Name

Type

Description

NA

NA

NA

Query Parameters

The preceding URI has the following query parameters:

Name

Type

Constraint

Description

clientId

String

Mandatory

Defines the unique client Id that is provided by Aeris.

cs

String

Mandatory

Defines the unique client secret (cs) that is provided by Aeris.

accountId

String

Mandatory

Defines the account Id to which the device is provisioned. You can log in to the AerPort portal to get this Id.

as

String

Mandatory

Defines the unique API key as account secret (as) that is assigned to the customer account for accessing the API. This API key can be retrieved from the AerPort Portal.

requesterId

String

Mandatory

Email id of the user who is generating the token. However, it is not mandatory to be the same as defined in the AerPort.

grant_type

String

Mandatory

Defines a static value as client_credentials.

HTTP Headers

The following standard and custom HTTP headers are supported.

Request Headers

HTTP headers available for the request are as follows:

Field Name

Value

Constraint

Accept

application/json

Optional

Content-Type

application/json

Mandatory

Accept-Charset

utf-8

Optional

Response Headers

HTTP headers available for the response are as follows:

Field Name

Value

Description

Content-Type

application/json

Defines the response format.

Content-Length

<n>

The content length value varies for each response.

Date

<Date time Stamp>

Date time stamp of receiving the response.

Method Type

Method Type

GET

Request Payload Description

The request payload is provided as JSON objects with the following attributes:

N/A

Response Payload Description

The response payload is provided as JSON objects with the following attributes:

Attribute Name

Data Type

Description

token

String

Defines the unique JWT token which must be used to execute any other account related API.

token_type

String

Defines the token type, which always as "Bearer"

expires_in

EPOCH

Returns the EPOCh timestamp when the token will expire. It is usually one year time for expiring a token.

Sample Request

GET /api/token?clientId=XXX_XXX_XXXX&cs=89b63a42473ce52dd522531af3caf2d5adf92335a2&accountId=18002&as=98aeddc0-xxxx-xxxx-xxxx-afxxxxaxxxx7& requesterId=abc@xyz.com&grant_type=client_credentials

HTTP/1.1

Host: connectivity.aerisapis.com

Content-Type: application/json

Cache-Control: no-cache

Sample Response

{

"token": "eyJhbGciOiJIUzI1NiIsInxxxxxxxxxxVCJ9.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx........................bS9Y",

"token_type": "Bearer",

"expires_in": 1585655108

}

Have more questions? Submit a request

0 Comments

Article is closed for comments.