Skip to main content

Error handling and code

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:

  • error.date: Date of this payload

  • error.title: The error message

  • error.details: May contain additional information such as a unique reference of the error

  • error.operation: With long running asynchronous operations this contains a title for the operation

  • error.messages: If this error contains child errors then you will find them here.

  • error.errorurl: You can disregard this element

  • reason: Same as error.title

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

CODE
{
  "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:

CODE
{
  "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:

CODE
{
  "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.

CODE
{
  "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:

  • You are calling an API method that does not exist or is announced but not yet released.

  • The API expects a mandatory URL parameter but you did not supply it. Or the an integer ID is expected in the URL path but you supply e.g. an alphanumeric sequence.

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!

CODE
{
    "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!

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.