Access Token (POST)
  • 30 Jan 2024
  • 1 Minute to read
  • Contributors

    Access Token (POST)


      Article Summary

      In order to perform actions using the Harmony SASE API, a temporary authorization token must be generated using the workspace API Key.

      POST /v1/auth/authorize

      Note:
      Each generated access token expires 60 minutes after being issued

      Parameters: None

      Request Body:

      Property Data TypeDescription
      grantTypeStringAuthorize request type: 'api_key'.
      apiKeyStringAPI key from Generate New Token in the web client.

      Request Example:

      curl -X 'POST' -H 'Content-Type: application/json' \
      -d '{                          
        "grantType": "api_key",
        "apiKey": "<API_KEY>"
      }' 'https://api.perimeter81.com/api/v1/auth/authorize'

      Response:

      Status Code

      Message/JSON Response Body

      Description

      200

      See Response Body table below.

      Success. Access token and expiration time returned.

      Response Body:

      PropertyData TypeDescription

      data

      Object

      Return object with access token and its expiration timestamp.

      token

      String

      Type of token. Value is ‘bearer’.

      accessToken

      String

      Access token. Expires according to accessTokenExpire.

      accessTokenExpire

      Date

      Timestamp of access token’s expiration.

      Response Example:

      {
         "data":{
            "tokenType":"bearer",
            "accessToken":"<ACCESS_TOKEN>",
            "accessTokenExpire":<TOKEN_EXPIRE_TIME>
         }
      }

      Now you can use the APIs for external calls during the following hour.



      Was this article helpful?

      What's Next