Skip to navigation

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.

Request

This endpoint expects an object.
client_idstringRequired
API client ID.
client_secretstringRequired
API client secret.
grant_typeenumRequired

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

Allowed values:

Response

Authenticated
access_tokenstringOptional

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

token_typestringOptional

Type of the token, which is always Bearer.

expires_inintegerOptional

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

Errors

404
Not Found Error