Authentication and Authorization Errors
The following error codes are returned during authentication and authorization.
| HTTP Status | Business Code | Description |
|---|---|---|
| 401 | AUTH_REQUIRED | Missing Authorization request header |
| 401 | AUTH_INVALID | Authentication information is invalid |
| 401 | AUTH_EXPIRED | The access token has expired |
| 403 | AUTH_SCOPE_DENIED | The current client does not have the permission required by this endpoint |
Insufficient Permission Response
AUTH_SCOPE_DENIED identifies the permission required by the current operation.
json
{
"code": "AUTH_SCOPE_DENIED",
"message": "This operation requires the device:control permission. Update the API Client permissions in the Developer Console and obtain a new access token.",
"requestId": "req_001",
"data": {
"requiredScope": "device:control"
}
}After receiving this error:
- Add the permission in
data.requiredScopeto the API client in the Developer Console. - Save the permission settings.
- Obtain a new access token.
- Retry the operation with the new token.
For example, a client with only device:read receives requiredScope: device:control when it attempts to switch a relay.
