Error Handling
All error responses use a uniform JSON format.
json
{
"error": "error_code",
"error_description": "Description of the error"
}HTTP status codes
| HTTP Status | Error Code | Description |
|---|---|---|
| 400 | validation_error | Invalid request data (missing fields, wrong format) |
| 401 | invalid_client | Invalid or missing access token |
| 403 | access_denied | OAuth client has been revoked |
| 403 | insufficient_scope | The client does not have the required permission |
| 404 | not_found | Resource not found |
| 429 | rate_limit_exceeded | Too many requests. Wait and try again. |
Note: For
429, the response includes aRetry-Afterheader with the wait time in seconds.
Handling errors
JavaScript
javascript
const response = await fetch('https://my.offisy.at/api/oauth/v2/resource/appointments', {
headers: { 'Authorization': 'Bearer {access_token}' }
});
if (!response.ok) {
const error = await response.json();
console.error(`${error.error}: ${error.error_description}`);
if (response.status === 429) {
const retryAfter = response.headers.get('Retry-After');
console.log(`Retry after ${retryAfter} seconds`);
}
}