Skip to main content

OpenApi

The entire INFast API is developed using OpenApi as the single source of truth. OpenApi is a standard format for API specifications (more information here). Specifically, this file defines the API routes, the format of their inputs/outputs, as well as the API documentation.

In fact, the entire API Reference section is automatically generated from an OpenApi file. This file also defines the validation of input data (which can result in this type of error).

Download it!

To download the latest version of the OpenApi file, click here.

You can use this file for your HTTP client (Postman, Paw, etc.), but also to generate typed clients in your language. Feel free to check out codegens, we love it!

TypeScript Types

If you're in a TypeScript environment, you can use our type definitions file to cast the API inputs/outputs. This file is directly derived from our OpenApi specs (thru our codegen). Here’s an example of usage:

import axios from 'axios';
import { InfastApi } from './infast-api.model.codegen';
const config = {
method: 'get',
maxBodyLength: Infinity,
url: 'https://api.infast.fr/api/v2/documents/[objectId]',
headers: {
Accept: 'application/json',
Authorization: 'Bearer <token>',
},
};

const response = await axios.request<InfastApi.Documents.FindDocuments.ResponseBody>(config);

// At that point, response.data is typed by the API response type.

To download the latest version of the TypeScript Types, click here.