MENU navbar-image

Introduction

This documentation aims to provide all the information you need to work with our API.

Authenticating requests

To authenticate requests, include an Authorization header with the value "Bearer {YOUR_AUTH_KEY}".

All authenticated endpoints are marked with a requires authentication badge in the documentation below.

You can retrieve your token by logging to /api/login.

AFNOR

Flows

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://demo-back.invoxhub.io/api/afnor/v1/flows/search';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'offset' => 27,
            'limit' => 22,
            'where' => [
                'flowId' => 'b',
                'updatedAfter' => 'architecto',
                'updatedBefore' => 'architecto',
                'flowType' => [
                    'CustomerInvoice',
                ],
                'trackingId' => 'n',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://demo-back.invoxhub.io/api/afnor/v1/flows/search" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"offset\": 27,
    \"limit\": 22,
    \"where\": {
        \"flowId\": \"b\",
        \"updatedAfter\": \"architecto\",
        \"updatedBefore\": \"architecto\",
        \"flowType\": [
            \"CustomerInvoice\"
        ],
        \"trackingId\": \"n\"
    }
}"
const url = new URL(
    "http://demo-back.invoxhub.io/api/afnor/v1/flows/search"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "offset": 27,
    "limit": 22,
    "where": {
        "flowId": "b",
        "updatedAfter": "architecto",
        "updatedBefore": "architecto",
        "flowType": [
            "CustomerInvoice"
        ],
        "trackingId": "n"
    }
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Submit a flow.

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://demo-back.invoxhub.io/api/afnor/v1/flows';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'multipart/form-data',
            'Accept' => 'application/json',
        ],
        'multipart' => [
            [
                'name' => 'flowInfo[trackingId]',
                'contents' => 'b'
            ],
            [
                'name' => 'flowInfo[name]',
                'contents' => 'n'
            ],
            [
                'name' => 'flowInfo[flowSyntax]',
                'contents' => 'PDF'
            ],
            [
                'name' => 'flowInfo[flowProfile]',
                'contents' => 'Basic'
            ],
            [
                'name' => 'flowInfo[sha256]',
                'contents' => 'f6e239b134858664042a6fa39089ca56fc04d15a35adcd6b5d54b8d164586b17'
            ],
            [
                'name' => 'file',
                'contents' => fopen('/tmp/php81l6vm6liqcp1oCKnme', 'r')
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://demo-back.invoxhub.io/api/afnor/v1/flows" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "flowInfo[trackingId]=b"\
    --form "flowInfo[name]=n"\
    --form "flowInfo[flowSyntax]=PDF"\
    --form "flowInfo[flowProfile]=Basic"\
    --form "flowInfo[sha256]=f6e239b134858664042a6fa39089ca56fc04d15a35adcd6b5d54b8d164586b17"\
    --form "file=@/tmp/php81l6vm6liqcp1oCKnme" 
const url = new URL(
    "http://demo-back.invoxhub.io/api/afnor/v1/flows"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "multipart/form-data",
    "Accept": "application/json",
};

const body = new FormData();
body.append('flowInfo[trackingId]', 'b');
body.append('flowInfo[name]', 'n');
body.append('flowInfo[flowSyntax]', 'PDF');
body.append('flowInfo[flowProfile]', 'Basic');
body.append('flowInfo[sha256]', 'f6e239b134858664042a6fa39089ca56fc04d15a35adcd6b5d54b8d164586b17');
body.append('file', document.querySelector('input[name="file"]').files[0]);

fetch(url, {
    method: "POST",
    headers,
    body,
}).then(response => response.json());

Request   

POST api/afnor/v1/flows

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: multipart/form-data

Accept      

Example: application/json

Body Parameters

flowInfo   object   
trackingId   string  optional  

Le texte ne peut contenir plus de 36 caractères. Example: b

name   string   

Le texte ne peut contenir plus de 255 caractères. Example: n

flowSyntax   string   

Example: PDF

Must be one of:
  • PDF
  • PDFtoCut
flowProfile   string  optional  

Example: Basic

Must be one of:
  • Basic
  • CIUS
  • Extended-CTC-FR
sha256   string  optional  

Must match the regex /^[a-f0-9]{64}$/. Example: f6e239b134858664042a6fa39089ca56fc04d15a35adcd6b5d54b8d164586b17

file   file   

Must be a file. Example: /tmp/php81l6vm6liqcp1oCKnme

Download a file related to a given flow.

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://demo-back.invoxhub.io/api/afnor/v1/flows/architecto';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'docType' => 'ReadableView',
            'docIndex' => 16,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://demo-back.invoxhub.io/api/afnor/v1/flows/architecto" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"docType\": \"ReadableView\",
    \"docIndex\": 16
}"
const url = new URL(
    "http://demo-back.invoxhub.io/api/afnor/v1/flows/architecto"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "docType": "ReadableView",
    "docIndex": 16
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: http://localhost:5174
access-control-expose-headers: X-New-Access-Token
 

{
    "message": "Vous avez été déconnecté(e)."
}
 

Request   

GET api/afnor/v1/flows/{flow_id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

flow_id   string   

The ID of the flow. Example: architecto

Body Parameters

docType   string  optional  

Example: ReadableView

Must be one of:
  • ReadableView
docIndex   integer  optional  

La valeur doit être supérieure ou égale à 1. Example: 16

GET /afnor/v1/healthcheck

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://demo-back.invoxhub.io/api/afnor/v1/healthcheck';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://demo-back.invoxhub.io/api/afnor/v1/healthcheck" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://demo-back.invoxhub.io/api/afnor/v1/healthcheck"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: http://localhost:5174
access-control-expose-headers: X-New-Access-Token
 

{
    "message": "Vous avez été déconnecté(e)."
}
 

Request   

GET api/afnor/v1/healthcheck

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Auth

Log in a User.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://demo-back.invoxhub.io/api/login';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'email' => 'yourname@email.com',
            'password' => 'yourpassword',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://demo-back.invoxhub.io/api/login" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"yourname@email.com\",
    \"password\": \"yourpassword\"
}"
const url = new URL(
    "http://demo-back.invoxhub.io/api/login"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "email": "yourname@email.com",
    "password": "yourpassword"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request   

POST api/login

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

email   string   

The email of the user. Example: yourname@email.com

password   string   

The password of the user. Example: yourpassword

Log out a User.

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://demo-back.invoxhub.io/api/logout';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://demo-back.invoxhub.io/api/logout" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://demo-back.invoxhub.io/api/logout"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request   

POST api/logout

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json