Documentation (Beta)
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Authentication API

How to get access token and refresh token

Login to the Network Server account:

curl --location 'https://{host}/api/auth/login' 
--header 'Content-Type: text/plain' 
--data-raw '{"username":"user@email.com","password":"password"}'`

If the request is successful, an access token and a refresh token will be recieved in responce body.

Response Body:

  {     
  "token": "your ACCESS_TOKEN",     
  "refreshToken": "your REFRESH_TOKEN" 
  }

  • {host} = Network Server or OAM host
  • {username} = username(your email) from Network Server/OAM account
  • {password} = password from Network Server/OAM account

How to use access token to authorise API calls

To authorise API calls use the following header:

X-Authorization: Bearer <your ACCESS_TOKEN>

How to get new Access Token using Refresh Token

Use refresh token to get new access token and new refresh token:

curl --location 'https://{host}}/api/auth/token' 
--header 'Content-Type: text/plain' 
--data '{"refreshToken":" your REFRESH_TOKEN"}' 

Response Body:

  {     
  "token": "your ACCESS_TOKEN",     
  "refreshToken": "your REFRESH_TOKEN" }

  • {host} = Network Server or OAM host

What is the Time To Live of authentication tokens

  • Access token has TTL 2hours
  • Refresh token has TTL 24hours