1. Authorization

Version 34.1 by Giorgi Mdivnishvili on 2024/04/26 15:58

 

Authorization: Starting Your Integration

The first step in integrating with our API is the authorization process. As a developer, you'll be assigned a unique username and password. These credentials are essential for generating the access token, a critical component that must be included in the headers of all subsequent API requests. This token validates your requests and grants you access to the full suite of our services.

Request URL - [POST]

Request Parameters

none

Request Body

{
"login": "string",
"password": "string"
}

Response Body

{
 "accessToken": "string",
 "refreshToken": "string",
 "passwordExpired": true
}

expiration time 30 days for both tokens:

accessToken - 43200 min

refreshToken - 2591968 sec

Schema

 

Success

AuthResponse{

accessTokenstring
nullable: true
refreshTokenstring
nullable: true
passwordExpiredboolean

}

RefreshToken

To retrieve an existing accesstoken , you can  make a request for the given endpoint below and pass in the body refreshToken, after that you will receive an accessToken. You can use this method at your discretion.

Request URL - [POST]

Request Parameters

none

Request Body example

{
 "refreshToken": "string"
}

Response Body

{
 "accessToken": "string",
 "refreshToken": "string",
 "passwordExpired": true
}

Important

Error

Implementing Authorization in Subsequent Requests

For every API request after the initial authentication, it's crucial to include the authorization token in the request header. This ensures your requests are authorized and can access the necessary resources. Here's how to properly include your token:

  • Header Key: Authorization
  • Header Value: Bearer [Your Token Here] - Use the bearer token provided in the initial authentication response. The authorization type should be specified as Bearer Token.

Additionally, to ensure your requests are properly formatted and recognized, include the following headers:

  • Content-Type: Specify this header as application/json to indicate the format of the request body.
  • Header Key: X-nugios-timezone
  • Header Value: 240 - Adjust this value to match your local timezone offset in minutes.

Incorporating these headers with their respective values is essential for the successful processing of your API requests.