Document verification API (1.0)

Download OpenAPI specification:Download

Introduction

Hiveo document verification API.

Through this API you can: * Classify and extract data for a given document * Classify, extract data and validate a given document against Hiveo validation rules

This Hiveo API is organised around REST and JSON, and uses standard HTTP response codes, verbs and authentication.

Overview

API versioning

The Hiveo API is accessed through an generic URL. If you want to call a specific version of the Hiveo API, use the x-version HTTP header to specify it. For example:

x-version:1.0

Any breaking changes to the API will be introduced through a new version number.

Non-breaking changes may be introduced without changing version. These may include additional fields to JSON data structures, optional parameters to API calls, new features that can be exposed through existing API calls, or new API calls.

Our API versioning uses 2 digits, such as major.minor (1.0, 1.1…). An increment in the major digit means that ground-breaking changes have been introduced (ex: rework on entire resources, major changes in the authentication system…).

To access to the documentation of a specific version, use /version/v<version number>.html.

For example, for version 1.0: #tag/v1.0.

Security

All endpoints require authentication. We use the Client Credentials Grant type.

To authenticate API requests, you must provide a valid bearer token in an HTTP header:

Authorization: Bearer {bearer_token}

Here is an example authentication request for the Client Credentials Grant type:

POST /auth/realms/hiveo/protocol/openid-connect/token HTTP/1.1
Host: https://authstaging.hiveo.fr
Content-Type: application/x-www-form-urlencoded
Authorization: Basic c3ViY2xpYzpjZDg5ZjM1OC1iMjhiLTRiMjktYjBhZC0wNWEzYjcxMWFjZDc=
Content-Type: application/x-www-form-urlencoded

client_secret=<your client secret>&client_id=<your client id>&grant_type=client_credentials&scope=openid

Errors

Hiveo uses conventional HTTP response codes to indicate the success or failure of an API request.

In general:

  • 2xx codes indicate success,
  • 4xx codes indicate an error that failed given the information provided (e.g., a required parameter was omitted, the resource does not exist…),
  • 5xx codes indicate an error with Hiveo’s servers.
HTTP code Label Meaning
200 OK Success
206 OK Not exactly one resulting prediction (you should ask user advice)
400 Bad Request The request was unacceptable, often due to missing a required parameter
401 Unauthorized No valid API key provided
402 Request Failed The parameters were valid but the request failed
403 Forbidden The API key doesn’t have permissions to perform the request
404 Not Found The requested resource doesn’t exist
415 Unsupported Media Type The request does not support this type of media
429 Too Many Requests Too many requests hit the API too quickly
500, 502, 503, 504 Server Errors Something went wrong on Hiveo’s side

Authentication

OauthClientSecurity

Security Scheme Type OAuth2
clientCredentials OAuth Flow
Token URL: https://{environment}.hiveo.fr/auth/realms/hiveo/protocol/openid-connect/auth
Refresh URL: https://{environment}.hiveo.fr/auth/realms/hiveo/protocol/openid-connect/token
Scopes:

    Extract

    Compose any of the unitary operations (classify, extract)

    Extract

    Try to classify and then extract data of a document.

    Authorizations:
    Request Body schema: application/json

    An extraction query requires:

    • either a binary document encoded in base64 or a classificationID of a previous extraction
    • the identifier of the organization concerned
    • optionnaly, a type of document if it is already known in a perfectly safe way. But the knownDocumentType parameter is mandatory if you use classificationId parameter.
    organisationId
    required
    string [ 1 .. 1024 ] characters

    The organisation unique ID composed with country code and national ID (of company or work unit) joined with a dash.

    classificationId
    string 36 characters

    the classificationId returned by a previous analysis or extraction. It permits to skip the extraction phase on an input document. It is very useful when the classification phase is not sure about the document type and so when you force the extraction with a document type

    object (Document)

    The input document as base64-encoded bytes.

    Currently only "application/pdf" are supported.

    knownDocumentType
    string
    Enum: fr_kbis fr_extrait_d1 fr_extrait_sirene fr_attestation_urssaf fr_attestation_msa fr_attestation_rsi fr_attestation_fiscale_societe_fille fr_attestation_fiscale_societe_mere fr_attestation_fiscale_societe_independante fr_assurance_responsabilite_civile_professionnelle fr_assurance_decennale_standard

    The Hiveo document type.

    Responses

    Response Schema: application/json
    required
    object (ClassificationResult)

    The result of a classification request. Each result has its own id for future reference.

    You can store the file informations if you need to extract data or validate the document in a sequential call.

    object (extractions)

    The extraction results for a given file (and possibly multiple document types).

    Response Schema: application/json
    required
    object (ClassificationResult)

    The result of a classification request. Each result has its own id for future reference.

    You can store the file informations if you need to extract data or validate the document in a sequential call.

    Request samples

    Content type
    application/json
    {
    • "document": {
      },
    • "organisationId": "FR-84122605300012",
    • "knownDocumentType": "fr_kbis",
    • "classificationId": "205e5851-f8b1-41ab-84e0-ee9bba7ad0b6"
    }

    Response samples

    Content type
    application/json
    {
    • "classification": {
      },
    • "extractions": {
      }
    }

    Extract (async)

    Try to classify and then extract data of a document on asynchronous way.

    Authorizations:
    Request Body schema: application/json

    An extraction query requires:

    • either a binary document encoded in base64 or a classificationID of a previous extraction
    • the identifier of the organization concerned
    • optionnaly, a type of document if it is already known in a perfectly safe way. But the knownDocumentType parameter is mandatory if you use classificationId parameter.
    organisationId
    required
    string [ 1 .. 1024 ] characters

    The organisation unique ID composed with country code and national ID (of company or work unit) joined with a dash.

    classificationId
    string 36 characters

    the classificationId returned by a previous analysis or extraction. It permits to skip the extraction phase on an input document. It is very useful when the classification phase is not sure about the document type and so when you force the extraction with a document type

    object (Document)

    The input document as base64-encoded bytes.

    Currently only "application/pdf" are supported.

    knownDocumentType
    string
    Enum: fr_kbis fr_extrait_d1 fr_extrait_sirene fr_attestation_urssaf fr_attestation_msa fr_attestation_rsi fr_attestation_fiscale_societe_fille fr_attestation_fiscale_societe_mere fr_attestation_fiscale_societe_independante fr_assurance_responsabilite_civile_professionnelle fr_assurance_decennale_standard

    The Hiveo document type.

    Responses

    Response Schema: application/json
    jobId
    required
    string 36 characters

    UUID of the created job

    startDate
    string [ 10 .. 24 ] characters

    Creation date job

    status
    string

    Status of the job at starting

    Request samples

    Content type
    application/json
    {
    • "document": {
      },
    • "organisationId": "FR-84122605300012",
    • "knownDocumentType": "fr_kbis",
    • "classificationId": "205e5851-f8b1-41ab-84e0-ee9bba7ad0b6"
    }

    Response samples

    Content type
    application/json
    {
    • "jobId": "205e5851-f8b1-41ab-84e0-ee9bba7ad0b6",
    • "startDate": "2022-05-20T13:34:07.150Z",
    • "status": "IN PROGRESS"
    }

    Analysis

    Compose any of the unitary operations (classify, extract, validate operations)

    Analyze

    Try to classify the document, then extract data and use them to validate the document against Hiveo rules.

    Authorizations:
    Request Body schema: application/json

    An analysis query requires:

    • either a binary document encoded in base64 or a classificationID of a previous analysis or extraction
    • the identifier of the organization concerned
    • optionnaly, a type of document if it is already known in a perfectly safe way. But the knownDocumentType parameter is mandatory if you use classificationId parameter.
    organisationId
    required
    string [ 1 .. 1024 ] characters

    The organisation unique ID composed with country code and national ID (of company or work unit) joined with a dash.

    classificationId
    string 36 characters

    the classificationId returned by a previous analysis or extraction. It permits to skip the extraction phase on an input document. It is very useful when the classification phase is not sure about the document type and so when you force the extraction with a document type

    object (Document)

    The input document as base64-encoded bytes.

    Currently only "application/pdf" are supported.

    knownDocumentType
    string
    Enum: fr_kbis fr_extrait_d1 fr_extrait_sirene fr_attestation_urssaf fr_attestation_msa fr_attestation_rsi fr_attestation_fiscale_societe_fille fr_attestation_fiscale_societe_mere fr_attestation_fiscale_societe_independante fr_assurance_responsabilite_civile_professionnelle fr_assurance_decennale_standard

    The Hiveo document type.

    Responses

    Response Schema: application/json
    required
    object (ClassificationResult)

    The result of a classification request. Each result has its own id for future reference.

    You can store the file informations if you need to extract data or validate the document in a sequential call.

    object (extractions)

    The extraction results for a given file (and possibly multiple document types).

    object (validations)

    The validation results contain:

    1. A global state of the validation (usable and valid booleans)
    2. The details of the validation results for each document type
    Response Schema: application/json
    required
    object (ClassificationResult)

    The result of a classification request. Each result has its own id for future reference.

    You can store the file informations if you need to extract data or validate the document in a sequential call.

    Request samples

    Content type
    application/json
    {
    • "document": {
      },
    • "organisationId": "FR-84122605300012",
    • "knownDocumentType": "fr_kbis",
    • "classificationId": "205e5851-f8b1-41ab-84e0-ee9bba7ad0b6"
    }

    Response samples

    Content type
    application/json
    {
    • "classification": {
      },
    • "extractions": {
      },
    • "validations": {
      }
    }

    Analyze (async)

    Try to classify the document, then extract data and use them to validate the document against Hiveo rules. Async job is launched.

    Authorizations:
    Request Body schema: application/json

    An analysis query requires:

    • either a binary document encoded in base64 or a classificationID of a previous analysis or extraction
    • the identifier of the organization concerned
    • optionnaly, a type of document if it is already known in a perfectly safe way. But the knownDocumentType parameter is mandatory if you use classificationId parameter.
    organisationId
    required
    string [ 1 .. 1024 ] characters

    The organisation unique ID composed with country code and national ID (of company or work unit) joined with a dash.

    classificationId
    string 36 characters

    the classificationId returned by a previous analysis or extraction. It permits to skip the extraction phase on an input document. It is very useful when the classification phase is not sure about the document type and so when you force the extraction with a document type

    object (Document)

    The input document as base64-encoded bytes.

    Currently only "application/pdf" are supported.

    knownDocumentType
    string
    Enum: fr_kbis fr_extrait_d1 fr_extrait_sirene fr_attestation_urssaf fr_attestation_msa fr_attestation_rsi fr_attestation_fiscale_societe_fille fr_attestation_fiscale_societe_mere fr_attestation_fiscale_societe_independante fr_assurance_responsabilite_civile_professionnelle fr_assurance_decennale_standard

    The Hiveo document type.

    Responses

    Response Schema: application/json
    jobId
    required
    string 36 characters

    UUID of the created job

    startDate
    string [ 10 .. 24 ] characters

    Creation date job

    status
    string

    Status of the job at starting

    Request samples

    Content type
    application/json
    {
    • "document": {
      },
    • "organisationId": "FR-84122605300012",
    • "knownDocumentType": "fr_kbis",
    • "classificationId": "205e5851-f8b1-41ab-84e0-ee9bba7ad0b6"
    }

    Response samples

    Content type
    application/json
    {
    • "jobId": "205e5851-f8b1-41ab-84e0-ee9bba7ad0b6",
    • "startDate": "2022-05-20T13:34:07.150Z",
    • "status": "IN PROGRESS"
    }

    Jobs

    Get info about jobs

    Job result

    Get the result of an asynchronous job

    Authorizations:
    path Parameters
    jobId
    required
    string
    Example: 205e5851-f8b1-41ab-84e0-ee9bba7ad0b6

    The Hiveo ID of the job

    Responses

    Response Schema: application/json
    endDate
    string [ 10 .. 24 ] characters

    End date of the job

    jobId
    string 36 characters

    UUID of the job

    object (Analysis result sample)

    The results contain the unitary results of each step:

    1. Classification
    2. Extraction
    3. Validation
    startDate
    string [ 10 .. 24 ] characters

    Requested date of the job

    status
    string

    Current status of the job

    Request samples

    var axios = require('axios');
    
    var config = {
      method: 'get',
      url: 'https://apistaging.hiveo.fr/documents/jobs/39f12476-8125-4dc5-b4ec-c2b49b9b77e1',
      headers: {
        'x-version': '1.0',
        'Authorization': 'Bearer {{access_token}}'
      }
    };
    
    axios(config)
    .then(function (response) {
      console.log(JSON.stringify(response.data));
    })
    .catch(function (error) {
      console.log(error);
    });
    

    Response samples

    Content type
    application/json
    {
    • "jobId": "205e5851-f8b1-41ab-84e0-ee9bba7ad0b6",
    • "startDate": "2022-05-20T13:34:07.150Z",
    • "status": "SUCCEEDED",
    • "endDate": "2022-05-20T13:39:21.627Z",
    • "result": {
      }
    }

    Endpoints added in version 1.0

    This section lists all endpoints added in version 1.0.

    Extract

    Try to classify and then extract data of a document.

    Authorizations:
    Request Body schema: application/json

    An extraction query requires:

    • either a binary document encoded in base64 or a classificationID of a previous extraction
    • the identifier of the organization concerned
    • optionnaly, a type of document if it is already known in a perfectly safe way. But the knownDocumentType parameter is mandatory if you use classificationId parameter.
    organisationId
    required
    string [ 1 .. 1024 ] characters

    The organisation unique ID composed with country code and national ID (of company or work unit) joined with a dash.

    classificationId
    string 36 characters

    the classificationId returned by a previous analysis or extraction. It permits to skip the extraction phase on an input document. It is very useful when the classification phase is not sure about the document type and so when you force the extraction with a document type

    object (Document)

    The input document as base64-encoded bytes.

    Currently only "application/pdf" are supported.

    knownDocumentType
    string
    Enum: fr_kbis fr_extrait_d1 fr_extrait_sirene fr_attestation_urssaf fr_attestation_msa fr_attestation_rsi fr_attestation_fiscale_societe_fille fr_attestation_fiscale_societe_mere fr_attestation_fiscale_societe_independante fr_assurance_responsabilite_civile_professionnelle fr_assurance_decennale_standard

    The Hiveo document type.

    Responses

    Response Schema: application/json
    required
    object (ClassificationResult)

    The result of a classification request. Each result has its own id for future reference.

    You can store the file informations if you need to extract data or validate the document in a sequential call.

    object (extractions)

    The extraction results for a given file (and possibly multiple document types).

    Response Schema: application/json
    required
    object (ClassificationResult)

    The result of a classification request. Each result has its own id for future reference.

    You can store the file informations if you need to extract data or validate the document in a sequential call.

    Request samples

    Content type
    application/json
    {
    • "document": {
      },
    • "organisationId": "FR-84122605300012",
    • "knownDocumentType": "fr_kbis",
    • "classificationId": "205e5851-f8b1-41ab-84e0-ee9bba7ad0b6"
    }

    Response samples

    Content type
    application/json
    {
    • "classification": {
      },
    • "extractions": {
      }
    }

    Analyze

    Try to classify the document, then extract data and use them to validate the document against Hiveo rules.

    Authorizations:
    Request Body schema: application/json

    An analysis query requires:

    • either a binary document encoded in base64 or a classificationID of a previous analysis or extraction
    • the identifier of the organization concerned
    • optionnaly, a type of document if it is already known in a perfectly safe way. But the knownDocumentType parameter is mandatory if you use classificationId parameter.
    organisationId
    required
    string [ 1 .. 1024 ] characters

    The organisation unique ID composed with country code and national ID (of company or work unit) joined with a dash.

    classificationId
    string 36 characters

    the classificationId returned by a previous analysis or extraction. It permits to skip the extraction phase on an input document. It is very useful when the classification phase is not sure about the document type and so when you force the extraction with a document type

    object (Document)

    The input document as base64-encoded bytes.

    Currently only "application/pdf" are supported.

    knownDocumentType
    string
    Enum: fr_kbis fr_extrait_d1 fr_extrait_sirene fr_attestation_urssaf fr_attestation_msa fr_attestation_rsi fr_attestation_fiscale_societe_fille fr_attestation_fiscale_societe_mere fr_attestation_fiscale_societe_independante fr_assurance_responsabilite_civile_professionnelle fr_assurance_decennale_standard

    The Hiveo document type.

    Responses

    Response Schema: application/json
    required
    object (ClassificationResult)

    The result of a classification request. Each result has its own id for future reference.

    You can store the file informations if you need to extract data or validate the document in a sequential call.

    object (extractions)

    The extraction results for a given file (and possibly multiple document types).

    object (validations)

    The validation results contain:

    1. A global state of the validation (usable and valid booleans)
    2. The details of the validation results for each document type
    Response Schema: application/json
    required
    object (ClassificationResult)

    The result of a classification request. Each result has its own id for future reference.

    You can store the file informations if you need to extract data or validate the document in a sequential call.

    Request samples

    Content type
    application/json
    {
    • "document": {
      },
    • "organisationId": "FR-84122605300012",
    • "knownDocumentType": "fr_kbis",
    • "classificationId": "205e5851-f8b1-41ab-84e0-ee9bba7ad0b6"
    }

    Response samples

    Content type
    application/json
    {
    • "classification": {
      },
    • "extractions": {
      },
    • "validations": {
      }
    }

    Endpoints added in version 1.1

    This section lists all endpoints added in version 1.1.

    Extract (async)

    Try to classify and then extract data of a document on asynchronous way.

    Authorizations:
    Request Body schema: application/json

    An extraction query requires:

    • either a binary document encoded in base64 or a classificationID of a previous extraction
    • the identifier of the organization concerned
    • optionnaly, a type of document if it is already known in a perfectly safe way. But the knownDocumentType parameter is mandatory if you use classificationId parameter.
    organisationId
    required
    string [ 1 .. 1024 ] characters

    The organisation unique ID composed with country code and national ID (of company or work unit) joined with a dash.

    classificationId
    string 36 characters

    the classificationId returned by a previous analysis or extraction. It permits to skip the extraction phase on an input document. It is very useful when the classification phase is not sure about the document type and so when you force the extraction with a document type

    object (Document)

    The input document as base64-encoded bytes.

    Currently only "application/pdf" are supported.

    knownDocumentType
    string
    Enum: fr_kbis fr_extrait_d1 fr_extrait_sirene fr_attestation_urssaf fr_attestation_msa fr_attestation_rsi fr_attestation_fiscale_societe_fille fr_attestation_fiscale_societe_mere fr_attestation_fiscale_societe_independante fr_assurance_responsabilite_civile_professionnelle fr_assurance_decennale_standard

    The Hiveo document type.

    Responses

    Response Schema: application/json
    jobId
    required
    string 36 characters

    UUID of the created job

    startDate
    string [ 10 .. 24 ] characters

    Creation date job

    status
    string

    Status of the job at starting

    Request samples

    Content type
    application/json
    {
    • "document": {
      },
    • "organisationId": "FR-84122605300012",
    • "knownDocumentType": "fr_kbis",
    • "classificationId": "205e5851-f8b1-41ab-84e0-ee9bba7ad0b6"
    }

    Response samples

    Content type
    application/json
    {
    • "jobId": "205e5851-f8b1-41ab-84e0-ee9bba7ad0b6",
    • "startDate": "2022-05-20T13:34:07.150Z",
    • "status": "IN PROGRESS"
    }

    Analyze (async)

    Try to classify the document, then extract data and use them to validate the document against Hiveo rules. Async job is launched.

    Authorizations:
    Request Body schema: application/json

    An analysis query requires:

    • either a binary document encoded in base64 or a classificationID of a previous analysis or extraction
    • the identifier of the organization concerned
    • optionnaly, a type of document if it is already known in a perfectly safe way. But the knownDocumentType parameter is mandatory if you use classificationId parameter.
    organisationId
    required
    string [ 1 .. 1024 ] characters

    The organisation unique ID composed with country code and national ID (of company or work unit) joined with a dash.

    classificationId
    string 36 characters

    the classificationId returned by a previous analysis or extraction. It permits to skip the extraction phase on an input document. It is very useful when the classification phase is not sure about the document type and so when you force the extraction with a document type

    object (Document)

    The input document as base64-encoded bytes.

    Currently only "application/pdf" are supported.

    knownDocumentType
    string
    Enum: fr_kbis fr_extrait_d1 fr_extrait_sirene fr_attestation_urssaf fr_attestation_msa fr_attestation_rsi fr_attestation_fiscale_societe_fille fr_attestation_fiscale_societe_mere fr_attestation_fiscale_societe_independante fr_assurance_responsabilite_civile_professionnelle fr_assurance_decennale_standard

    The Hiveo document type.

    Responses

    Response Schema: application/json
    jobId
    required
    string 36 characters

    UUID of the created job

    startDate
    string [ 10 .. 24 ] characters

    Creation date job

    status
    string

    Status of the job at starting

    Request samples

    Content type
    application/json
    {
    • "document": {
      },
    • "organisationId": "FR-84122605300012",
    • "knownDocumentType": "fr_kbis",
    • "classificationId": "205e5851-f8b1-41ab-84e0-ee9bba7ad0b6"
    }

    Response samples

    Content type
    application/json
    {
    • "jobId": "205e5851-f8b1-41ab-84e0-ee9bba7ad0b6",
    • "startDate": "2022-05-20T13:34:07.150Z",
    • "status": "IN PROGRESS"
    }

    Job result

    Get the result of an asynchronous job

    Authorizations:
    path Parameters
    jobId
    required
    string
    Example: 205e5851-f8b1-41ab-84e0-ee9bba7ad0b6

    The Hiveo ID of the job

    Responses

    Response Schema: application/json
    endDate
    string [ 10 .. 24 ] characters

    End date of the job

    jobId
    string 36 characters

    UUID of the job

    object (Analysis result sample)

    The results contain the unitary results of each step:

    1. Classification
    2. Extraction
    3. Validation
    startDate
    string [ 10 .. 24 ] characters

    Requested date of the job

    status
    string

    Current status of the job

    Request samples

    var axios = require('axios');
    
    var config = {
      method: 'get',
      url: 'https://apistaging.hiveo.fr/documents/jobs/39f12476-8125-4dc5-b4ec-c2b49b9b77e1',
      headers: {
        'x-version': '1.0',
        'Authorization': 'Bearer {{access_token}}'
      }
    };
    
    axios(config)
    .then(function (response) {
      console.log(JSON.stringify(response.data));
    })
    .catch(function (error) {
      console.log(error);
    });
    

    Response samples

    Content type
    application/json
    {
    • "jobId": "205e5851-f8b1-41ab-84e0-ee9bba7ad0b6",
    • "startDate": "2022-05-20T13:34:07.150Z",
    • "status": "SUCCEEDED",
    • "endDate": "2022-05-20T13:39:21.627Z",
    • "result": {
      }
    }