V1 Get Token REST Service for OAuth Authentication

GET /ws/rest/service/v1/oauth/token

Version: 21.7

Purpose

Use this REST service to generate an OAuth token to access V1 REST services.

Authorization

Use the OAuth type integration user and password reset using email.

Input Authorization

Username and password using Basic Authentication

All parameters should be URL encoded.

Basic Auth and username

Optional Request Parameter

Use the following parameter to modify the token expiration in the API request:

Request Parameter

Data Type

Description

expiry

string

Enter the optional token expiration duration in seconds. For example, expiry = 300. The default value is 3600 seconds.

Response Format

A JSON object is returned containing 'status', 'data', and 'message'.

For a successful status (status code 200), the token details will be sent in the JSON output response.

If the status is not a success, a JSON object containing a 'message' is returned.

Sample Response

  1. Tenant Administrator will be able to create Integration User from UI. Integration Username is unique across all Organization (that is: Email ID).

    Note: A default integration user is not created based on the company short name.

  2. User will get the 'Reset Password' email from IDCS.
  3. Reset password can also be done from the Primavera Lobby.
  4. Unifier Essentials only supports OAuth to access the tenant-specific REST APIs. The customer has to get the Access token from Unifier Essentials based on the username and password (Basic authentication).
  5. Sample response from token API from Unifier Essentials:

    Token Request: http://<domain-name>/ws/rest/service/v1/oauth/token

    Response:

    {

    "token":"yJ4NXQjUzI1NiI6IkRoQXRBNENzTDRUdEIza1BLRlY3TTZSUzlCbExBamIxbDBvV2V6OXpaUXMiLCJ4NXQiOiJXMlR",

    "expire":"3600",

    "endpoint":"/rest1",

    request_headers:{

    "x-unifier-tenant":"<idcs stripe id>",

    "x-unifier-tenant-code":"<tenant code>"

    }

    }

  6. User needs to append endpoint as shown below in the API calls as shown below: https://<domain-name>/<endpoint>/ws/rest/<apipath>
  7. User needs to add the headers (x-unifier-tenant, x-unifier-tenant-code & ‘Authorization: Bearer), which are received from the OAuth token API in the API request as shown below in the curl command.

    curl --location --request GET 'http://<domain-name>/rest1/ws/rest/service/v1/ds/data-elements' \

    --header 'x-unifier-tenant: idcs-c9aadb60fba24a7dba567cbdc844fb51' \

    --header 'x-unifier-tenant-code: Tenant-2' \

    --header 'Authorization: Bearer eyJ4NXQjUzI1NiI6IkRoQXRBNENzTDRUdEIza1BLRlY3TTZSUzlCbExBamIxbDBvV2V6OXpaUXMiLCJ4NXQiOiJXMlR2WXl'



Last Published Tuesday, April 15, 2025