POST /auth/login
This method generates the authentication token and the refresh token.
To generates the authentication token and the refresh token:
Login to the swagger with PM credentials.
Use POST /auth/login to send an HTTP POST request to the authentication service.
-
On Request body select application/json from drop-down list.
-
Under Request body, enter the username and password of your PM system.
{ "username": "string", "password": "string" }
The following table describes the request body parameters.Parameter Name
Sample Value
Description
>username
Integer (int32)
-Note: This parameter is mandatory.>password String
-Note: This parameter is mandatory. Click on Execute to generate the request URL.
Request URL:
The following table lists the expected responses.https://<IP_Address>:<PORT>/auth/login
Response Type
Value
Schema
Valid Response
200 OK
{ "token": "string", "refreshToken": "string", "version": "string", "build": "string", "brand": "string" }
Note:The token "string" value is used for authorizing all other APIs and the refreshToken "string" value is used to generate a new token as the token expires every 45 minutes.
Error Response
400 Bad Request
{ "mitelErrorCode": "string", "errorMsg": "string", "developerMsg": "string", "responseStatus": "100 CONTINUE", "responseCode": 0 }
- Copy the token from the successful response.
{ "token": "eyJhbGciOiJIUzUxMiJ9.eyJyb2xlIjoiMSIsIlVTRVJfUkVDX0lEIjoiMSIsInN1YiI 6Ik1pdGVsIiwiaWF0IjoxNzE1MTU3NjQxLCJleHAiOjE3MTUxNjAzNDF9.yA7YCQ0a0gu3o yKFUeCpA3DWulSha57oUZNDvbm6NZq5ykx6vMWDBml-slX3STfub7hb0ezcmYx6XBs7x0uzzg", "refreshToken": "134e6a49-85a8-4a52-aa58-ef972ca8f0bd", "version": "7.x.SPx.HFx", "build": "7.x.x.x.x", "brand": "mxone" }
-
Click on Authorize on top of the Authentication Token.
-
Enter the token value you copied.
-
Click on Authorize and then click on Close.
↑