Technical Review
Errors
Understand the two error families returned by the drio management API.
The drio management API returns two different error families. Which one you get depends on which part of the API you are calling.
First Question: Which Route Family Failed?
| If the failing route is... | Expect this error format |
|---|---|
/.well-known/* or /api/v1/auth/* | OAuth-style error response |
/api/v1/me, /api/v1/templates/*, or /api/v1/apps/* | drio resource API error envelope |
1. OAuth Errors
Discovery and auth routes use OAuth-style error responses.
Applies to:
/.well-known/*/api/v1/auth/*
Example:
{
"error": "invalid_request",
"error_description": "Missing required field: refresh_token"
}Common auth error codes:
invalid_requestinvalid_client_metadatainvalid_grantinvalid_tokenserver_error
2. Resource API Errors
Templates, apps, and user routes use the drio API error envelope.
Applies to:
/api/v1/me/api/v1/templates/*/api/v1/apps/*
Example:
{
"error": {
"code": "not_found",
"message": "App not found",
"details": null,
"requestId": "4c9b58ff-69a7-4ccf-840d-a0f1ec9f9d77"
}
}Common Protected Error Codes
bad_requestunauthorizedforbiddennot_foundvalidation_errorinternal_error
Typical Status Codes
| Status | Meaning |
|---|---|
400 | Invalid input or malformed auth request |
401 | Missing, invalid, or expired bearer token |
403 | Authenticated but not allowed to access that resource |
404 | The requested route or resource does not exist |
500 | Unexpected server-side failure |
How To Debug Faster
- if the failure came from
/api/v1/auth/*, debug it as an OAuth issue - if the failure came from
/api/v1/apps/*or/api/v1/me, debug it as a resource API issue - use
requestIdfrom the resource envelope when coordinating support or log lookup