V1 Get Token REST Service for Basic Authentication

GET http://<host>:<port./ws/rest/service/v1/login

Prerequisite

Your user integration status must be set to Active.

Purpose

Use this REST service to generate an authentication token to access V1 REST services. You can set the token expiration from the integration user interface in terms of days, hours, and minutes. The validity of the token in terms of date and time is displayed in the response.

Valid values for expiry duration is 1 through 500. By default the expiry duration is set to 180 days.

Instructions For Using Any Generic REST Client

To generate a token using any generic rest client:

  1. In the Authorization tab, select Basic Authentication Type.
  2. Enter your user name and password.
  3. Select Update Request to generate the necessary Authorization header in the Headers tab.

Response Format

Headers -Authorization:Basic <Basic Auth of integration user>

Sample Response

{

"expiryDate": "05/18/2021",

"Timezone": "(UTC-08:00) Pacific Time (US & Canada)",

"expiryTime": "05/18/2021 11:44 AM",

"status": 200,

"token": "eyJ0eXAiOiJEQiJ9.eyJ1c2VybmFtZSI6IiQkZGVsdDMifQ==.02318C44-9F3A-F931-3F14-C6FA7576F55E7D8D9975C46B5805179BD10D890DF15F"

}

You can use this token in the Header section of all REST services for authentication.

Note:

The expiry date is displayed as per the user date format preferences set in the Integration user interface.

Sample Header

Key Value
Authorization Basic eyJ0eXAiOiJEQiJ9.eyJ1c2VybmFtZSI6IiQkZGVsdDMifQ==.02318C44-9F3A-F931-3F14-C6FA7576F55E7D8D9975C46B5805179BD10D890DF15F

Supported HTTP Status Codes

The following HTTP status codes are supported for this rest service:

HTTP Status Code Status Message Error Message
200 Success none
400 Bad Request Invalid expiry.
401 Unauthorized

Empty or Invalid Authorization Header.

Invalid Authorization Header