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
Retrieves a set of flows matching the provided search criteria.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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)."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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)."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.