Skip to content

API basics ​

All the things on a developer checklist when you're integrating a new API

Environments ​

We have two environments. Sandbox for setting up and testing your integration. Production for live traffic.

NameURLDescription
SandboxSetup and integration testing with fake checks
ProductionLive traffic with real checks

The sandbox is intended for testing and development purposes only. Availability is not guaranteed and may be affected by maintenance, updates, or system load.

Authentication ​

The EyeDP api uses the oAuth client credentials flow for authentication.

First generate an access token using a client id and client secret. Then use that token for calling api endpoints. Access tokens are valid for 60 minutes.

Generating a token ​

Method: POST

Endpoint: /api/authenticate

Example request ​

json
{
    "clientId":"YOUR_CLIENT_ID",
    "clientSecret":"YOUR_CLIENT_SECRET"
}

Copy-pasteable curl against sandbox (replace the placeholders with the credentials you were sent at onboarding):

bash
curl -X POST https://api-sandbox.eyedp.com/api/authenticate \
  -H "Content-Type: application/json" \
  -d "{\"clientId\":\"YOUR_CLIENT_ID\",\"clientSecret\":\"YOUR_CLIENT_SECRET\"}"

Example response ​

json
{
    "accessToken": "eyJhbGciOi...",
    "expires": 3600
}

expires is the token lifetime in seconds (60 minutes).

If required fields are missing, ASP.NET returns a field-validation dictionary instead of the errors list used elsewhere:

json
{
    "ClientId": [
        "The ClientId field is required."
    ],
    "ClientSecret": [
        "The ClientSecret field is required."
    ]
}

Using the token ​

The access token must be included in all other api calls. Include it by putting

Header nameValue
AuthorizationBearer your-token

How to get a client id and secret ​

You will be sent credentials during onboarding. We will be making this self service soon!

Open Api ​

The api has a full open API spec ready to import into Postman or code generation tools:

Postman ​

We've created a basic Postman collection to help get you get started with our API.

You can export it from our Postman page.

Webhooks ​

The EyeDP platform is event driven and a lot of work happens in background jobs. The results from jobs such as document extraction or document risk checks won't be available immediately or returned straight away from your requests.

For these reasons webhooks are an important part of the platform. It's how we notify your system of jobs finishing and results being available, and of changes to your cases so you can keep your own records up to date.

Webhooks are fully configurable through the API. Please see the webhooks endpoint page for more details.

Versioning ​

The api uses semantic versioning to give you control on how you want to handle api changes.

Minor version increases signify changes to the open api spec like additional properties on an object or a new endpoint being added. Major version increases are for breaking changes like objects removed from the open api spec.

Specify an api version by passing it in a api-version query parameter. Any requests sent without a specified version will default to the latest. We highly recommend specifying a version so you don't encounter unexpected changes from the api.

Version example request: https://api-sandbox.eyedp.com/api/cases/123?api-version=1.0

Version history ​

DateVersionNotes
01/05/20251.0Here we go!

Ping ​

Authenticated GET /api/Ping returns "Pong". Use it as a connectivity check once you have a token.

bash
curl https://api-sandbox.eyedp.com/api/Ping \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Rate limiting ​

By default requests are limited to 15 per second.

Custom arrangements can be made, please contact us if you require more.

Bad requests ​

Bad requests are returned when there is something wrong with the request. Most API errors use a standardised list of errors, and say which of the request's fields each is about:

json
{
    "errors": [
        "Date of birth is not a valid date"
    ],
    "fields": {
        "DobYear": ["Date of birth is not a valid date"],
        "DobMonth": ["Date of birth is not a valid date"],
        "DobDay": ["Date of birth is not a valid date"]
    }
}

This is the response from trying to create a case with an invalid date of birth.

PropertyTypeNotes
errorsarray of stringsEvery message, each once.
fieldsobjectThe messages about each of the request's fields, keyed by the field's name in the API, such as AddressPostcode, so you can show each by the field to correct. A message about more than one field, such as a date of birth's, is under each of them. A message about no one field is only in errors. Left out when no message is about a field. For a settings change, the keys are the settings, such as required-fields.

The API reads a request's field names whatever their case, so DOBYear and Addressline1, as some tables in these docs give them, work as well as DobYear and AddressLine1. The keys in fields always use the API's own casing, which can differ from what you sent: for example DobYear, AddressLine1 and CountryofCitizenship. Compare them case-insensitively.

A request body that can't be read is rejected before anything in it is checked, so the 400 is only about that:

  • A value of the wrong type, such as text where a number goes, is under its field, named as you sent it. A nested field is named by its path, such as workflowOptions.documentId. Only the first one is reported, so fix it and send the request again. Update a case is the exception: it reports every one, with the request's other errors.
  • JSON that can't be read is only in errors. The message gives the line and position where reading stopped, such as (line 3, position 19). The position counts bytes, so a character such as é counts as two. A body of the wrong kind, such as a list where the endpoint takes an object, is only in errors too.
json
{
    "errors": [
        "The value of dobYear isn't the right type. Check the field's type in the docs."
    ],
    "fields": {
        "dobYear": ["The value of dobYear isn't the right type. Check the field's type in the docs."]
    }
}

Missing required fields on some endpoints (including authenticate) instead return an ASP.NET field-validation dictionary, keyed by property name:

json
{
    "ClientId": [
        "The ClientId field is required."
    ]
}

Error codes ​

Some errors carry a code: a short, fixed name for what went wrong, so your integration can act on it.

WARNING

Error codes are used only by the definition endpoints, Get document extraction and three upload errors about definitionKey. Every other error keeps the body described on its endpoint, such as the standard list of errors.

Example

json
{
    "type": "https://docs.eyedp.com/basics/#error-codes",
    "title": "Definition not found",
    "status": 404,
    "detail": "No document definition uk_council_tax@9 is available.",
    "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01",
    "code": "definition_not_found",
    "errors": [
        "No document definition uk_council_tax@9 is available."
    ]
}

The content type is application/json.

FieldTypeDescription
typestringA link to this section.
titlestringA short summary of the error.
statusintegerThe HTTP status code, the same as the response's.
detailstringWhat went wrong, in words you can show or log.
traceIdstringAn id for the request. Give it to support if you contact us about the error.
codestringThe error code, from the table below.
errorsarray of stringsThe messages, as in the standard list of errors.
fieldsobjectThe messages about each request field at fault, keyed by the field's name, as in the standard list of errors. Left out when no single field is at fault.

Match on code, never on the text. The title, detail and errors text may change.

Codes

This table says what each code means. For when an endpoint returns it and what to do, see that endpoint's errors.

CodeStatusMeaningErrors on
feature_not_enabled400Defined documents aren't enabled for your account.Upload as a defined document
definition_not_found400, 404 or 422The definition named in the request, or the one the document was processed with, isn't available to you.Upload as a defined document, Get definition and Get document extraction
invalid_request400The request can't be carried out as sent. detail says why.Upload as a defined document
document_still_extracting409The document's data is still being extracted.Get document extraction
document_not_defined422The document isn't a defined document.Get document extraction
document_not_extracted422The document's extraction failed, so there's no data to read.Get document extraction

New codes may be added. Treat a code you don't recognise by its status.