POST /auth/login

This method generates the authentication token and the refresh token.

To generates the authentication token and the refresh token:
  1. Login to the swagger with PM credentials.

  2. Use POST /auth/login to send an HTTP POST request to the authentication service.

  3. On Request body select application/json from drop-down list.

  4. 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.
  5. Click on Execute to generate the request URL.

    Request URL:
    https://<IP_Address>:<PORT>/auth/login
    The following table lists the expected responses.

    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
    }
  6. 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"
    }
  7. Click on Authorize on top of the Authentication Token.

  8. Enter the token value you copied.

  9. Click on Authorize and then click on Close.