Retrieval of a bearer token

When you want to perform any operation on a schema, you must have access to the project in which the schema exists. To gain access you require a bearer token. You can retrieve the bearer token from any external application by using the POST method.


You must have the following information before you retrieve the project details:

REST API request

To retrieve the information about the bearer token, you must use the request with the following attributes:

Request attributes Request parameters
HTTP method POST
Endpoint https://{OneTest_Server}/onetest-data/rest/v1/otd/login

refresh_token: XXXXX

project_id: 1150

Request body Null

Response code

You can view the following response after you run the request:
HTTP response code Response example
  "created_on":"2020-08-05 12:30:32", 
  "expires_on":"2020-08-12 12:30:32", 
    "account_roles":["administrator", "designer"] 

Error codes

The following table lists the error codes that can generate on the failure of the request:
HTTP error codes Response examples
401(Invalid Refresh token/Invalid Project Id)
    "timestamp": "2020-08-21T05:25:02.867Z", 
    "code": 401, 
    "messages": ["IO Exception occurred while retrieving user from OTS Server."] 
404(Null Project Id)
   "timestamp": "2020-09-04T06:52:08.213Z", 
    "code": 404, 
    "messages": ["Project Id cannot be null."] 

Example of the cURL command

You can also use the following cURL command to retrieve the details of a bearer token:

curl -X POST '' \ 
--header 'refresh_token: XXXX' \ 
--header 'projectid: 3400'