Skip to main content
Version: 10.0

Exception

If an error occurs while executing the REST API, then the web service responds with a HTTP response status code.

This may be a 4xx HTTP status, such as 400 Bad Request or 401 Unauthorized, or a 5xx code in the event of a server error.

In the case of most 4xx codes, the server will additionally respond with a payload in the response. The response will then contain an “exception” as a JSON structure.

This exception contains an error code errorCode, a text errorMessage with possible hints about the error and an (optional) stackTrace.

{
"errorMessage": "Web service parameter error",
"errorCode": -14,
"stackTrace": "...."
}

The structure will contain the following values:

  • errorCode (integer) - Error number
  • errorMessage - Description of error
  • stackTrace - Stack trace on the server where the error occurred (usually only important for Support)

Example of a call when the session token is invalid:

curl -X GET -i -H 'Accept: application/json' -H 'Authorization: Bearer eyJraWQiOiJyb3ZZTFQ4TXgwcTd1WW1i ... CO2TLHCiQCsuMf-1Vw' http://localhost:8080/webPDF/rest/documents/605c045c129a40adb95d7623e279fe8a/info  

HTTP/1.1 401
...

{
 "errorMessage": "Session for provided token not found",
 "errorCode": -60,
 "stackTrace": "..."
}