Skip to content

Error Handling

All error responses use a uniform JSON format.

json
{
  "error": "error_code",
  "error_description": "Description of the error"
}

HTTP status codes

HTTP StatusError CodeDescription
400validation_errorInvalid request data (missing fields, wrong format)
401invalid_clientInvalid or missing access token
403access_deniedOAuth client has been revoked
403insufficient_scopeThe client does not have the required permission
404not_foundResource not found
429rate_limit_exceededToo many requests. Wait and try again.

Note: For 429, the response includes a Retry-After header 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`);
  }
}

Offisy GmbH