Auth

Get Access Token (OAuth 2)

Retrieves an access token using an OAuth-2.0-compliant flow. Accepts form-encoded credentials using standard client_id and client_secret field names.

This method is specifically designed for OAuth 2.0 clients like Grafana that send credentials as form-encoded data. For JSON-based API calls, use Get Access Token.

The client ID and secret you provide when calling this method must be from a set of API credentials from your Eon account. To learn more about creating API credentials and completing the authentication flow, see Authentication.

The returned access token has the permissions included in the role you assigned to the API credentials. Always make sure the API credentials have the permissions needed for the API methods you want to use it for.

The access token is valid for 12 hours. After that, you must call this method again to get a new token.

post/v1/oauth2/token

Request

  • Base URL: https://%7Baccount-domain%7D.console.eon.io/api
  • URL: https://%7Baccount-domain%7D.console.eon.io/api/v1/oauth2/token
  • Auth: none declared

Request body

client_idstring required

API client ID.

client_secretstring required

API client secret.

grant_type'client_credentials' required

The OAuth 2.0 grant type you're using. Must be client_credentials.

Response

Authenticated

access_tokenstring

Access token, which you pass in the Authorization header when calling API methods.

token_typestring

Type of the token, which is always Bearer.

expires_ininteger

Length of time until the token expires, in seconds. Default: 43200 (12 hours).

Changes

No recorded changes to this operation across all 1 revision of this API.