Authentication API
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
To authorise API calls use the following header:
X-Authorization: Bearer <your ACCESS_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
- Access token has TTL 2hours
- Refresh token has TTL 24hours