The API returns HTTP error codes and a JSON payload whenever something goes wrong.

400 - Bad request

This is the default error code that you will receive. The reason of error is included in the JSON returned. They key properties to look at are:

Example with an API call accessing a document that does not exist:

{
  "error": {
    "operation": null,
    "date": "2020-12-15T08:34:38.7706101Z",
    "title": "The requested file does not exist.",
    "details": null,
    "errorurl": null,
    "messages": []
  },
  "reason": "The requested file does not exist."
}

Example of authentication attempt with invalid API key:

{
  "error": {
    "operation": null,
    "date": "2020-12-15T08:44:08.7986219Z",
    "title": "Invalid private key.",
    "details": null,
    "errorurl": null,
    "messages": []
  },
  "reason": "Invalid private key."
}

If your authentication token expired or is simply invalid, you will get an error like this:

{
  "error": {
    "operation": null,
    "date": "2020-12-15T10:00:45.4858252Z",
    "title": "Token invalid or expired.",
    "details": "Token invalid or expired.",
    "errorurl": null,
    "messages": [
      {
        "title": "Not authenticated",
        "details": "API construct session from token failed with error: Not authenticated",
        "errorurl": null
      }
    ]
  },
  "reason": "Not authenticated - API construct session from token failed with error: Not authenticated"
}

429 - Throttled

You receive this error when you reached the hourly allowance for API calls.

Note: Authentication API calls are not counted.

The error message contains information about the maximum allowance. It does not include information on when you can retry.

{
  "error": {
    "type": "Throttling error",
    "message": "Requests throttled. Maximum allowed 1000 per 01:00:00."
  },
  "reason": "Requests throttled. Maximum allowed 1000 per 01:00:00."
}

If you encounter such an error please wait for at least 10 seconds and try again.

If you consume your allowance within a very short time you will potentially have to wait for an hour. It is best to evenly spread API calls over the interval and reduce to a maximum the amount of calls to fit into the limits assigned to you.

404 - Not found

There may be different reasons for this:

This error always points to an invalid end point or invalid URL parameters. Please consult the documentation. The documentation may also contain errors in which case please let us know through support!

{
    "Message": "Cannot find the specified URL https://mycompany.eu.wordbee-translator.com/api/hello/world"
}

500 - Internal error

You normally would not receive any error of this kind.

If however you do then the API service may be temporarily unavailable or there is a defect in our code. In such a case we would appreciate a message from you to support!