360 Monitoring

Retrieve the WebPros access token

Changed on

This function returns the stored WebPros access token for 360 Monitoring.

This function does not accept any parameters. It returns the access_token value from the token bundle that the server stored during the WebPros single sign-on flow, and the number of seconds that remain before that token expires. The function never returns the refresh token or the rest of the token bundle.

The function fails with a data.reason value of no_valid_token when the server does not store a token or when the stored token is no longer valid. Use the 360Monitoring/webpros_auth_status function to find out why the stored token is not valid, and the 360Monitoring/webpros_auth_start function to start a new authentication flow.

The access token is a bearer credential. Transmit it only over HTTPS and do not write it to logs.

get/360Monitoring/webpros_auth_token

Request

  • Base URL
    https://whm-server.tld:2087/json-api
  • Auth
    HTTP basic

Response

The HTTP Request succeeded.

Example response

{
  "data": {
    "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NSJ9.Example",
    "error": "No valid authentication token is available.",
    "expires_in": 780,
    "reason": "no_valid_token"
  },
  "metadata": {
    "command": "webpros_auth_token",
    "namespace": "360Monitoring",
    "reason": "OK",
    "result": 1,
    "version": 1
  }
}

Changes