Skip to main content
Skip table of contents

Client Credentials Grant

MyQ X REST APIs use OAuth 2.0 access tokens for request authentication. Your access token serves as your authorization credential when interacting with the MyQ X REST API server.

To implement the REST API in your integration, you'll need to exchange your MyQ X client ID and client secret for an access token. This token must be included with your API requests to access protected resources.

Request an access token

Request a token by using client_credentials.

Example request:

CODE
Endpoint:
POST /api/auth/token

Headers:
Content-Type:application/json

Body: 
{
	"grant_type": "client_credentials",
	"scope": "{scopes}",
	"client_id": "{app client_id}",
	"client_secret": "{app secret}",
}

For more information on which scopes are needed for a certain endpoint, please refer to the Scopes page.

Retrieve an access token

If authentication is successful, you'll receive an access token that must be provided at any other API endpoint in the authorization header: Authorization: Bearer {{accessToken}}.

Example Response:

CODE
{
	"access_token": "{your_bearer_token}",
	"token_type": "Bearer",
	"expires_in": 1800,
	"scope": "{granted scopes}",
	"refresh_token": "{your_refresh_token}"
}

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.