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:
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.
Retrieving 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:
{
"access_token": "{your_bearer_token}",
"token_type": "Bearer",
"expires_in": 1800,
"scope": "{granted scopes}",
"refresh_token": "{your_refresh_token}"
}