Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

LogiSense APIs use JSON Web Tokens (JWT) for authentication. This article will explain how to obtain, use, and refresh a JWT. For more information about JWT read this.

...

Token Request Header

Definition

Accept

"Accept": "application/json"
Type: String
xhr.setRequestHeader('Accept', 'application/json')

Content-Type

"Content-Type": "application/x-www-form-urlencoded"
Type: String
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');

Token Request Parameter

Definition

username

"username": "myUsername"
Type: String
username= + myUsername + &password= + myPassword + &grant_type=password&client_id= + userClientId

password

"password": "myPassword"
Type: String
username= + myUsername + &password= + myPassword + &grant_type=password&client_id= + userClientId

grant_type

"grant_type": "password"
Type: String
username= + myUsername + &password= + myPassword + &grant_type=password&client_id= + userClientId

client_id

"client_id": "userClientId"
Type: String
username= + myUsername + &password= + myPassword + &grant_type=password&client_id= + userClientId

...

Token Response Property

Definition

access_token

"access_token": "A 512 character base64 string"
Type: String
This is the token you will include in your API requests

refresh_token

"refresh_token": "A 512 character base64 string"
Type: String
This is the token you will include in a request to refresh your access

token_type

"token_type": "bearer"
Type: String
When making API requests the Authorization header value will include 'Bearer' + the access token

expires_in

"expires_in": "1800"
Type: String
The time, in seconds, for which the token is valid (maximum value 1800 - 30 minutes)

refresh_token

"refresh_token": "587deb8616844c58b9991c61eebb2dfd"
Type: String
This value will be included when you want to refresh your token

audience

"audience": "044b8ad6006845c29446b2f18e5b5909"
Type: String
The intended recipient of the token.

.issued

".issued": "2022-11-01T19:49:41Z"
Type: String
Indicates when the token was issued by the Authorization Server. ISO 8601 format.

.expires

".expires": "2022-11-01T20:19:41Z"
Type: String
Indicates when the token expires. ISO 8601 format.

...

API Request Headers

Definition

Accept

"Accept": "application/json"
Type: String
xhr.setRequestHeader('Accept', 'application/json')

Content-Type

"Content-Type": "application/json"
Type: String
xhr.setRequestHeader('Content-Type', 'application/json');

Authorization

"Authorization": "Bearer + yourBase64token"
Type: String
xhr.setRequestHeader('Authorization', 'Bearer ' + yourBase64token);

...

Response Body Property

Definition

trackingId

"trackingId": "06404d2e-5334-4283-9c79-057087f26822"
Type: String
Audit tracking number for the request

totalCount

"totalCount": 8
Type: Number
The number of items returned

items

"items": array
Type: Array
The resultant list of objects

...

Refresh Request Parameter

Definition

refresh_token

"refresh_token": base64 encoded string A JWE or JWS in 'Compact Serialization Format'
Type: String
This value was received when requesting the original token and then subsequent refresh_token requests.

grant_type

"grant_type": "refresh_token"
Type: String
Use the value 'refresh_token' for refresh requests

client_id

"client_id": "044b8ad6006845c29446b2f18e5b5909"
Type: String
This will be the same as the initial token request.

...