Errors

Errors returned by Scan Documents API

Overview

Scan Documents API uses conventional HTTP response codes to indicate the success or failure of an API request. In general:

  • Codes in the 2XX range indicate success.
  • Codes in the 4XX range indicate problems with the request, like missing parameters.
  • Codes in the 5XX range indicate problems with Scan Documents servers.

Errors messages conform to RFC 7807 and use a Content-Type of application/problem+json.

General Errors

This payload is for 4XX client errors, except validation errors, and 5XX errors.

type
string

A URL that identifies the problem type. Visit the URL to learn more about this problem.

title
string

A short, human-readable summary of the problem type.

status
integer

The HTTP status code generated by the server for this occurrence of the problem.

message
string

A human-readable explanation specific to this occurrence of the problem.

Example

Here is an example of a 404 error response when a file is not found:

{
  "type": "https://scan-documents.com/docs/api/errors/not-found",
  "title": "Not Found",
  "status": 404,
  "message": "File with id file_123 not found."
}

Validation Errors

This payload is for 4XX client errors that are caused by validation errors.

type
string

A URL that identifies the problem type. Visit the URL to learn more about this problem.

title
string

A short, human-readable summary of the problem type.

status
integer

The HTTP status code generated by the server for this occurrence of the problem.

errors
Errors[]

A human-readable explanation specific to this occurrence of the problem.

Example

Here is an example of a 422 error response when there is a validation error:

{
  "type": "https://scan-documents.com/docs/api/errors/validation-error",
  "title": "Validation Error",
  "status": 422,
  "errors": {
      "input": ["input does not contains a valid input id."]
    }
}