Getting started

Get Access to API

Authentication

Making your first request

Guides

Generate Doc X-Ray

Generate Bank X-Ray

Generate Financial X-Ray

Generate ESG X-Ray

Generate Manager X-Ray

Concepts

Overview

Request

Reports

Medium

Doc X-Ray

Bank X-Ray

Financial X-Ray

ESG X-Ray

Manager X-Ray

Resources

API versioning

Webhooks

Uploading a media

Add a creator to your request

Generate Doc X-Ray

<aside> ⚠️ WARNING In order to follow this guide, you will first need to get access to our API (Get Access to API) and be able to send requests using our Authentication method

</aside>

In this page, you will find a step-by-step guide that will walk you through the generation of a Doc X-Ray using the October Connect API.

In this guide, you will generate your first Doc X-Ray using the following steps:


1. Create a request

For the first step of the analysis, create a request with a POST call to /requests

<aside> ℹ️ To learn how to assign this request to a specific user from an email address, consult : Add a creator to your request

</aside>

In the example below, all fields are mandatory except if mentioned otherwise:

POST /requests
{
  "code": {
    "type": "siren",
    "id": "514673987"
  }
}

The API will answer with additional fields on the request:

{
  "request": {
    "id": "[requestId]", // Unique ID of the request
    "code": {
      "type": "siren",
      "id": "514673987"
  }
  "status": "pending_analysis",
  "stage": "1.1",
  ...
  }
}

If you wish to re-fetch the data of a request, you can make a GET call to /requests/[id].

<aside> ℹ️ For more information about the requests end-points, please refer to the API reference (Request API Reference)

</aside>


2. Upload a Media

The upload of a document is done in 3 steps:

  1. POST /media to our API with the type and metadata of the file you wish to send us. You will receive data needed to upload to S3.
  2. Upload the file to AWS S3 using the data received from the previous step.
  3. Once the upload is successful, call POST /media/[id] to set the status to online and optionally add the period and date of the document.

To read a detailed step-by-step guide, please read Resources: Uploading a media

<aside> 📦 Note: The maximum allowed file size is 20MB.

</aside>

<aside> ℹ️ For more information about the allowed file formats, please refer to the API reference (Media API Reference)

</aside>


3. Retrieve Doc X-Ray

Once you have uploaded a media, our Doc X-Ray will be launched automatically and will return an analysis within a few minutes. However, if our OCR fails, we use an alternative extraction method that can take up to 48h.

To wait for the end of the request analysis, you have two options:

  1. Poll regularly the API to check when a new report is available; or
  2. Use webhooks to be notified when a new report has been created. (Our recommendation)

When the report has been created, refer to the cases below to knowmanager the next steps.

Polling the API

Make GET HTTP requests to /requests/[requestId] to receive the latest data of the request.

Make GET HTTP requests to /reports?source=doc_xray&request=[requestId] to receive the Doc X-Ray reports associated to the request

Using webhooks

<aside> 🪝 If you choose to use webhooks, start by checking out our Resource Webhooks

</aside>

We provide a webhook that will update you when a new report is generated:

{
  "event": "new_report",
  "requestId": "[requestId]",
  "reportId": "[reportId]"
}

After receiving webhooks, retrieve the data of the request or offer using the following GET HTTP calls:


4. Review the analysis

Once you have received the update using either the API calls or webhooks from the previous section, you can retrieve the Doc X-Ray report using the following GET HTTP call:

The API will answer with additional fields on the report:

{
  "report": {
    "id": "[reportId]",
    "request": "[requestId]",
    "source": "doc_xray",
    "raw": {
      "type": [
        {
          "class": "bank_statement",  // Classification of the document
          "confidence": 0.9999703168869019  // Level of confidence of classification
        },
        ...
      ]
      "reasons": [  // List of createria that was analysed
        {
          "criteria": {  // Criteria analized
            "creationDate": "2021-09-01 00:52:16",
            "modDate": "2021-09-03 12:25:51",
            "lastSigningTime": null,
            "modCreationDiff": 214415000
          },
          "sentiment": "bad",  // Sentiment about criteria
          "message": {
            "title": "Creation/Modification Time",
            "content": "modified 2.48 days after creation"
          },
          "typeCode": "time",  // Citeria type
          "level": "suspicious"  // 3 levels are possible: null/suspicious/fraudulent
        },
        ...
      ],
      "flag": {
        "color": "green",  
        "meta": [
            "time"
        ],
        "value": 0.018018018018018018  // Overall suspicious evaluation
      },
      ...
    }
  }
}

<aside> ℹ️ For more information about the reports end-points, please refer to the API reference (Report API Reference)

</aside>

← Previous

Getting started: Making your first request

Next →

Guides: Generate Bank X-Ray