Using the Dexi API
  • 25 Jan 2023
  • 2 Minutes to read
  • Contributors
  • Dark
    Light
  • PDF

Using the Dexi API

  • Dark
    Light
  • PDF

Article Summary

Access the Dexi API

To configure API access for your dexi.io account, you need to create an API key in your account settings. Once you have created an API key, sign in to the dexi.io app and continue to the API documentation pages.

9.png

Software development toolkits

We have the following software development toolkits (SDKs) available:

If you are interested in building an SDK not offered here, please contact us. We would love to discuss your project.

Work with Files

When you build a robot in Dexi that extracts files, the files are stored on Dexi's platform and the results of executing the robot just contain pointers to the actual files, the file IDs. A file ID looks something like this:

FILE:image/jpeg;2974;accounts/7353b678-80b0-48c0-8ecf-232feb7449aa/robots/b1e3b831-090b-4035-b3a9-bd064967327c/runs/fd0dba7d-c4a7-496c-8545-621c1aa32298/executions/fbaabff9-38f2-46b7-a876-fdba0568a307/results/9ad080ab-67fc-4406-a315-af918b7065ff/lines/e27346cd-4188-4081-861e-c0b2dea74b4a/ImageFile

To get a file from a file ID, complete the following steps:

  1. Get the results of the execution:
    • manually via the UI by selecting the Download button on the execution
      or
    • via the getResult API method
  2. The file IDs are available in the fields/columns containing files. In the example above, this is in the ImageFile field.
  3. Remove the part of the file ID string before accounts/.... In the example above, the string then becomes accounts/7353b678-80b0-48c0-8ecf-232feb7449aa/robots/b1e3b831-090b-4035-b3a9-bd064967327c/runs/fd0dba7d-c4a7-496c-8545-621c1aa32298/executions/fbaabff9-38f2-46b7-a876-fdba0568a307/results/9ad080ab-67fc-4406-a315-af918b7065ff/lines/e27346cd-4188-4081-861e-c0b2dea74b4a/ImageFile
  4. URL encodes this string as it may contain file paths. In the example above, the string remains unchanged.
  5. Pass the string as input to the getResultFile API method to download the actual file.

Timeouts on synchronous endpoints

To ensure platform stability, a 10 minute timeout is in place for the following synchronous API endpoints starting an execution of a run (configuration):

POST /runs/{runId}/execute/wait
POST /runs/{runId}/execute/inputs/wait
POST /runs/{runId}/execute/bulk/wait

Calls to either of these endpoints, where the execution takes longer than 10 minutes to complete, will fail (time out) with an HTTP 408 error.

NB! The current value of 10 minutes is subject to change if required for platform stability. You will be notified in case of significant changes.

We recommend using the asynchronous versions of the same endpoints:

POST /runs/{runId}/execute
POST /runs/{runId}/execute/inputs
POST /runs/{runId}/execute/bulk

The asynchronous versions return the execution id of the execution that was started. To to get notified when executions complete, we recommend combining the use of asynchronous endpoints with webhooks.

Rate Limit (Throttling)

To ensure platform stability, the number of requests that can be sent to the API is rate limited (throttled).

We currently allow ~75 requests per second per account (if you have multiple accounts, rate limiting is done per account.).

The limit is subject to change if significant interruption is caused to the system or if we scale up or down the parts of the system that handle API requests. However, we will notify users in advance of bigger changes to the numbers.

Performing a higher number of requests than these will cause HTTP 429 Too Many Requests responses.

A very high number of concurrent requests is considered a denial-of-service (DoS) attack, so please keep the number of requests below the limits specified above.

Limits on number of returned rows

Various API endpoints are limited to max 200 result rows per request, e.g.:

  • POST /datasets/{dataSetId}/rows
  • GET /runs

To get more result rows, please use paginatation as described on Paginating API Results.
:::

Additional Information

Several videos discussing the dexi.io API are available here:

https://www.youtube.com/playlist?list=PLp4OmF4ZDSfv-FI9zj1_4MrKLKELqUcG0


Was this article helpful?