Product Documentation API Resources
What is the Resources API?
A comprehensive overview can be found on the API Resources product page.
How do I send the documents?
Accepted formats
The accepted format is PDF.
Number of pages per call
The number of accepted files depends on the type of document:
– income tax FR: 1 file only
– FR civil servant payslip: 1 file only
– CAF FR payment certificate: several files
API Requests Resources
Parameters
The API system allows you to automate the validation of resource credentials via a simple HTTP POST request.
The accepted parameters are listed in the table below:
Parameter | Type | Format | Required Description | |
api_key | String | Yes | Your API Key | |
Format | String | No | ||
fr_income_taxes_file | File PDF | No | Income Tax Document | |
fr_civil_servant_payslip_file | File | No | Civil Servant Pay Slip | |
fr_caf_payment_certificate_file | File[] | No | One or more documents certificate of payment from the CAF |
Examples on different languages
curl -X POST -F "format={{ json or xml }}" -F "api_key={{ YOUR_API_KEY }}" -F "fr_****_file=@"{{ PATH_TO_FILE }}"" https://api.app.trustdochub.com/api/resources/v1
public String sendIdFileAndGetResults(MultipartFile file) { WebClient client = WebClient.create(); MultipartBodyBuilder builder = new MultipartBodyBuilder(); builder.part("fr_****_file", file.getResource()); builder.part("api_key", {{ YOUR_API_KEY >; return client.post() .uri(URI.create("https://api.app.trustdochub.com/api/resources/v1")) .contentType(MediaType.MULTIPART_FORM_DATA) .body(BodyInserters.fromMultipartData(builder.build())) .retrieve() .bodyToMono(String.class) .block(); }
import requests url = 'https://api.app.trustdochub.com/api/resources/v1' data = {'api_key': '{{ YOUR_API_KEY }}'} with open('file.txt', 'rb') as file: response = requests.post(url, data=data, files={'fr_****_file': file}) print(response.text)
const axios = require('axios'); const FormData = require('form-data'); const fs = require('fs'); const form = new FormData(); // Chemin vers le fichier que vous souhaitez envoyer const filePath = 'pathToFile'; // Vérifier si le fichier existe if (!fs.existsSync(filePath)) { console.error('Le fichier spécifié est introuvable :', filePath); process.exit(1); } // Ajouter le fichier au formulaire form.append('fr_****_file', fs.createReadStream(filePath)); // Ajouter le paramètre api_key form.append('api_key', 'votre_clé_api'); // Remplacez par votre clé API réelle (async () => { try { const response = await axios.post( 'https://api.app.trustdochub.com/api/resources/v1', form, { headers: { ...form.getHeaders(), // Si l'API nécessite une autorisation supplémentaire, ajoutez-la ici // 'Authorization': 'Bearer votre_token', }, } ); console.log('Réponse du serveur :', response.data); } catch (error) { if (error.response) { // La requête a été faite et le serveur a répondu avec un statut d'erreur console.error('Erreur du serveur :', error.response.status); console.error('Détails de l'erreur :', error.response.data); } else if (error.request) { // La requête a été faite mais aucune réponse n'a été reçue console.error('Aucune réponse reçue :', error.request); } else { // Erreur lors de la configuration de la requête console.error('Erreur lors de la configuration de la requête :', error.message); } } })();
<?php require 'vendor/autoload.php'; use GuzzleHttpClient; use GuzzleHttpExceptionRequestException; // URL cible $url = 'https://api.app.trustdochub.com/api/resources/v1'; // Chemin vers le fichier à envoyer $filePath = '{{ path_to_file }}'; // Vérifier si le fichier existe if (!file_exists($filePath)) { die('Fichier introuvable : ' . $filePath); } // Clé API $apiKey = 'votre_clé_api'; // Remplacez par votre clé API // Créer un client Guzzle $client = new Client(); try { $response = $client->post($url, [ 'multipart' => [ [ 'name' => 'fr_****_file', 'contents' => fopen($filePath, 'r'), 'filename' => 'specimen_passeport.webp', 'headers' => ['Content-Type' => 'image/webp'] ], [ 'name' => 'api_key', 'contents' => $apiKey ] ], 'verify' => true // Vérifier le certificat SSL ]); // Afficher le code de statut HTTP echo 'Code HTTP : ' . $response->getStatusCode() . "n"; // Afficher la réponse du serveur echo 'Réponse du serveur : ' . $response->getBody(); } catch (RequestException $e) { if ($e->hasResponse()) { echo 'Erreur du serveur : ' . $e->getResponse()->getStatusCode() . "n"; echo 'Réponse du serveur : ' . $e->getResponse()->getBody(); } else { echo 'Erreur lors de la requête : ' . $e->getMessage(); } }
Web interface
In addition to the API, you have access to a web interface that allows you to:
– View your subscription details
– Know how many checks you have left on each subscription
– Access your API call history
– Download JSON and XML reports for each call in the history
– Delete calls and corresponding data
Languages available
The web interface is available in the following languages:
–French
–English
Subscriptions tab
You can find a list of your subscriptions on the home page of the Identity API web interface, with the following information:
– Plan type (PRO, BUSINESS or CORPORATE)
– Frequency (monthly or annual)
– Active subscription: is your subscription active or not
– API key: the API key for your subscription
– Remaining Checks: The number of checks remaining on your subscription, over the period
Resources tab
The Resources tab (accessible if a Resources subscription is active) allows you to access various information and tools.
Historical
The API call history allows you to know the complete history of the calls made, with the following information:
- API call date
- Type of document checked
- Download the report in PDF / JSON / XML formats
- Removing the API call and corresponding data
"Verify a document" tool
The “Verify a document” tool allows you to send the documents to be checked directly from the web interface, without having to go through API calls!
The two approaches are complementary, depending on the needs.
The number of files that can be sent (per sending) is different depending on the document:
- Income tax: 1 file only
- Civil servant payslip: 1 file
- CAF payment notice: several files
The results will then be available in the history, which can be downloaded as a PDF, JSON or XML report.
API Responses
Format JSON
You can get the results in JSON format.
To do this, simply add the “format=json” parameter in your request, or not add the “format” parameter.
Here are the possible answers depending on the documents:
Income tax
{ "documentInfos": { "publicationDate": null, "signatureDate": "2022-06-13", "taxableIncomeReference": "44444", "sharesNumber": "1", "noticeReference": "2222222222222", "incomeYear": "2021", "declarant1": "XXXXXX YYYYYY", "taxNumberDeclarant1": "777777777777", "declarant2": null, "taxNumberDeclarant2": "null", "collectionDate": "2022-07-31" }, "certificate": { "validityStartDate": "2022-06-21", "validityEndDate": "2024-06-21", "issuerReference": "FR04", "issuerName": "AriadNEXT", "subjectReference": "FPE3", "issuer": "DIRECTION GENERALE DES FINANCES PUBLIQUES", "datesConsistency": true, "digitalSignature": true } }
Civil servant pay slip
{ "documentInfos": { "fullName": "MR XXXX YYYY", "employerSiret": "55555555555555", "periodStartDate": "2021-11-01", "periodEndDate": "2021-11-30", "contractStartDate": "1111-11-11", "netTaxableSalary": "2290.3", "netTaxableAccumulatedSalary": "27138.31" }, "certificate": { "validityStartDate": "2020-03-30", "validityEndDate": "2023-03-31", "issuerReference": "FR04", "issuerName": "AriadNEXT", "subjectReference": "FPE1", "issuer": "DIRECTION GENERALE DES FINANCES PUBLIQUES", "datesConsistency": true, "digitalSignature": true } }
CAF payment certificate (1 file / document of 2 pages)
{ "cafPaymentCertificates": [ { "documentInfos": { "documentDate": "2020-02-05", "dateOfBirth": "1980-08-14", "numberOfPages": 2, "beneficiaryNumberHeader": "8888888 M", "dateHourFooter": [ "050220202336", "050220202336" ], "beneficiaryNumberFooter": [ "8888888 M", "8888888 M" ], "barcodeNumber": [ "88888888888800000000", "88888888888800000000" ], "barcodeNumberDecoded": [ "88888888888800000000", "88888888888800000000" ] }, "documentInfosValidation": { "datesHeaderFooterValid": true, "beneficiaryNumberHeaderFooterValid": true, "beneficiaryNumberBarcodeNumberValid": true, "barcodeNumberBarcodeValid": true, "datesHeaderMetasValid": true, "datesFooterMetasValid": true } } ], "documentsValidation": null }
CAF payment certificate (2 files / documents of 2 pages)
{ "cafPaymentCertificates": [ { "documentInfos": { "documentDate": "2020-02-05", "dateOfBirth": "1980-08-14", "numberOfPages": 2, "beneficiaryNumberHeader": "8888888 M", "dateHourFooter": [ "050220202336", "050220202336" ], "beneficiaryNumberFooter": [ "8888888 M", "8888888 M" ], "barcodeNumber": [ "88888888888800000000", "88888888888800000000" ], "barcodeNumberDecoded": [ "88888888888800000000", "88888888888800000000" ] }, "documentInfosValidation": { "datesHeaderFooterValid": true, "beneficiaryNumberHeaderFooterValid": true, "beneficiaryNumberBarcodeNumberValid": true, "barcodeNumberBarcodeValid": true, "datesHeaderMetasValid": true, "datesFooterMetasValid": true } }, { "documentInfos": { "documentDate": "2021-02-05", "dateOfBirth": "1980-08-14", "numberOfPages": 2, "beneficiaryNumberHeader": "8888888 M", "dateHourFooter": [ "050220212336", "050220212336" ], "beneficiaryNumberFooter": [ "8888888 M", "8888888 M" ], "barcodeNumber": [ "88888888888800000000", "88888888888800000000" ], "barcodeNumberDecoded": [ "88888888888800000000", "88888888888800000000" ] }, "documentInfosValidation": { "datesHeaderFooterValid": true, "beneficiaryNumberHeaderFooterValid": true, "beneficiaryNumberBarcodeNumberValid": true, "barcodeNumberBarcodeValid": true, "datesHeaderMetasValid": true, "datesFooterMetasValid": true } } ], "documentsValidation": { "datesOfBirthValid": true, "datesHeaderFooterValid": true, "beneficiaryNumberHeaderFooterValid": true, "beneficiaryNumberBarcodeNumberValid": true, "barcodeNumberBarcodeValid": true, "datesHeaderMetasValid": true, "datesFooterMetasValid": true, "modificationDateMetasValid": true } }
Format XML
The second type of format available for responses is XML.
To do this, simply add the “format” parameter “xml” to your query.
Here are the possible answers depending on the documents:
Income tax
<FrenchIncomeTaxes> <documentInfos> <publicationDate/> <signatureDate>2022-06-13</signatureDate> <taxableIncomeReference>44444</taxableIncomeReference> <sharesNumber>1</sharesNumber> <noticeReference>2222222222222</noticeReference> <incomeYear>2021</incomeYear> <declarant1>XXXXX YYYYYY</declarant1> <taxNumberDeclarant1>777777777777</taxNumberDeclarant1> <declarant2/> <taxNumberDeclarant2>null</taxNumberDeclarant2> <collectionDate>2022-07-31</collectionDate> </documentInfos> <certificate> <validityStartDate>2022-06-21</validityStartDate> <validityEndDate>2024-06-21</validityEndDate> <issuerReference>FR04</issuerReference> <issuerName>AriadNEXT</issuerName> <subjectReference>FPE3</subjectReference> <issuer>DIRECTION GENERALE DES FINANCES PUBLIQUES</issuer> <datesConsistency>true</datesConsistency> <digitalSignature>true</digitalSignature> </certificate> </FrenchIncomeTaxes>
Civil servant pay slip
<FrenchCivilServantPayslip> <documentInfos> <fullName>MR XXXX YYYY</fullName> <employerSiret>55555555555555</employerSiret> <periodStartDate>2021-11-01</periodStartDate> <periodEndDate>2021-11-30</periodEndDate> <contractStartDate>1111-11-11</contractStartDate> <netTaxableSalary>2290.3</netTaxableSalary> <netTaxableAccumulatedSalary>27138.31</netTaxableAccumulatedSalary> </documentInfos> <certificate> <validityStartDate>2020-03-30</validityStartDate> <validityEndDate>2023-03-31</validityEndDate> <issuerReference>FR04</issuerReference> <issuerName>AriadNEXT</issuerName> <subjectReference>FPE1</subjectReference> <issuer>DIRECTION GENERALE DES FINANCES PUBLIQUES</issuer> <datesConsistency>true</datesConsistency> <digitalSignature>true</digitalSignature> </certificate> </FrenchCivilServantPayslip>
CAF payment certificate (1 file / document of 2 pages)
<FrenchCafPaymentCertificate> <cafPaymentCertificates> <cafPaymentCertificates> <documentInfos> <documentDate>2020-02-05</documentDate> <dateOfBirth>1980-08-14</dateOfBirth> <numberOfPages>2</numberOfPages> <beneficiaryNumberHeader>8888888 M</beneficiaryNumberHeader> <dateHourFooter> <dateHourFooter>050220202336</dateHourFooter> <dateHourFooter>050220202336</dateHourFooter> </dateHourFooter> <beneficiaryNumberFooter> <beneficiaryNumberFooter>8888888 M</beneficiaryNumberFooter> <beneficiaryNumberFooter>8888888 M</beneficiaryNumberFooter> </beneficiaryNumberFooter> <barcodeNumber> <barcodeNumber>88888888888800000000</barcodeNumber> <barcodeNumber>88888888888800000000</barcodeNumber> </barcodeNumber> <barcodeNumberDecoded> <barcodeNumberDecoded>88888888888800000000</barcodeNumberDecoded> <barcodeNumberDecoded>88888888888800000000</barcodeNumberDecoded> </barcodeNumberDecoded> </documentInfos> <documentInfosValidation> <datesHeaderFooterValid>true</datesHeaderFooterValid> <beneficiaryNumberHeaderFooterValid>true</beneficiaryNumberHeaderFooterValid> <beneficiaryNumberBarcodeNumberValid>true</beneficiaryNumberBarcodeNumberValid> <barcodeNumberBarcodeValid>true</barcodeNumberBarcodeValid> <datesHeaderMetasValid>true</datesHeaderMetasValid> <datesFooterMetasValid>true</datesFooterMetasValid> </documentInfosValidation> </cafPaymentCertificates> </cafPaymentCertificates> <documentsValidation/> </FrenchCafPaymentCertificate>
CAF payment certificate (2 files / documents of 2 pages)
<FrenchCafPaymentCertificate> <cafPaymentCertificates> <cafPaymentCertificates> <documentInfos> <documentDate>2020-02-05</documentDate> <dateOfBirth>1980-08-14</dateOfBirth> <numberOfPages>2</numberOfPages> <beneficiaryNumberHeader>8888888 M</beneficiaryNumberHeader> <dateHourFooter> <dateHourFooter>050220202336</dateHourFooter> <dateHourFooter>050220202336</dateHourFooter> </dateHourFooter> <beneficiaryNumberFooter> <beneficiaryNumberFooter>8888888 M</beneficiaryNumberFooter> <beneficiaryNumberFooter>8888888 M</beneficiaryNumberFooter> </beneficiaryNumberFooter> <barcodeNumber> <barcodeNumber>88888888888800000000</barcodeNumber> <barcodeNumber>88888888888800000000</barcodeNumber> </barcodeNumber> <barcodeNumberDecoded> <barcodeNumberDecoded>88888888888800000000</barcodeNumberDecoded> <barcodeNumberDecoded>88888888888800000000</barcodeNumberDecoded> </barcodeNumberDecoded> </documentInfos> <documentInfosValidation> <datesHeaderFooterValid>true</datesHeaderFooterValid> <beneficiaryNumberHeaderFooterValid>true</beneficiaryNumberHeaderFooterValid> <beneficiaryNumberBarcodeNumberValid>true</beneficiaryNumberBarcodeNumberValid> <barcodeNumberBarcodeValid>true</barcodeNumberBarcodeValid> <datesHeaderMetasValid>true</datesHeaderMetasValid> <datesFooterMetasValid>true</datesFooterMetasValid> </documentInfosValidation> </cafPaymentCertificates> <cafPaymentCertificates> <documentInfos> <documentDate>2021-02-05</documentDate> <dateOfBirth>1980-08-14</dateOfBirth> <numberOfPages>2</numberOfPages> <beneficiaryNumberHeader>8888888 M</beneficiaryNumberHeader> <dateHourFooter> <dateHourFooter>050220212336</dateHourFooter> <dateHourFooter>050220212336</dateHourFooter> </dateHourFooter> <beneficiaryNumberFooter> <beneficiaryNumberFooter>8888888 M</beneficiaryNumberFooter> <beneficiaryNumberFooter>8888888 M</beneficiaryNumberFooter> </beneficiaryNumberFooter> <barcodeNumber> <barcodeNumber>88888888888800000000</barcodeNumber> <barcodeNumber>88888888888800000000</barcodeNumber> </barcodeNumber> <barcodeNumberDecoded> <barcodeNumberDecoded>88888888888800000000</barcodeNumberDecoded> <barcodeNumberDecoded>88888888888800000000</barcodeNumberDecoded> </barcodeNumberDecoded> </documentInfos> <documentInfosValidation> <datesHeaderFooterValid>true</datesHeaderFooterValid> <beneficiaryNumberHeaderFooterValid>true</beneficiaryNumberHeaderFooterValid> <beneficiaryNumberBarcodeNumberValid>true</beneficiaryNumberBarcodeNumberValid> <barcodeNumberBarcodeValid>true</barcodeNumberBarcodeValid> <datesHeaderMetasValid>true</datesHeaderMetasValid> <datesFooterMetasValid>true</datesFooterMetasValid> </documentInfosValidation> </cafPaymentCertificates> </cafPaymentCertificates> <documentsValidation> <datesOfBirthValid>true</datesOfBirthValid> <datesHeaderFooterValid>true</datesHeaderFooterValid> <beneficiaryNumberHeaderFooterValid>true</beneficiaryNumberHeaderFooterValid> <beneficiaryNumberBarcodeNumberValid>true</beneficiaryNumberBarcodeNumberValid> <barcodeNumberBarcodeValid>true</barcodeNumberBarcodeValid> <datesHeaderMetasValid>true</datesHeaderMetasValid> <datesFooterMetasValid>true</datesFooterMetasValid> <modificationDateMetasValid>true</modificationDateMetasValid> </documentsValidation> </FrenchCafPaymentCertificate>
Status codes API
The following codes are returned by the API:
Code | Type | Description |
200 | Verification ok | The verification went smoothly |
401 | Not Authorized | API Key Is Not Correct |
402 | Insufficient appropriations | There are no more audit appropriations for the given period |
422 | Illegible Document | The document is not recognized or incorrect |
Checks performed on each type of document
Below you will find the list and description of the different fields and checks carried out on each type of identity document compatible with our products.
Income tax
Parameter Name | Type | Description |
documentInfo
|
||
publicationDate
|
String | Publish Date (can be null) |
signatureDate
|
String | Document Signing Date |
taxableIncomeReference
|
String | Reference Tax Income |
sharesNumber
|
String | Number of shares in the tax household |
recordReference
|
String | Review Reference |
incomeYear
|
String | Year of income |
Declarant1
|
Declaring | String |
taxNumberDeclarant1
|
String | Tax Number 1 |
Notifier2
|
Declarer | String |
taxNumberDeclarant2 | String | Tax Number 2 |
collectionDate
|
String | Pick Date |
certificate
|
||
validityStartDate
|
String | Digital Signature Certificate Validity Start Date |
validityEndDate
|
String | Digital Signature Certificate Validity End Date |
issuerReference
|
String | The issuer reference of the digital signature certificate |
issuerName
|
String | Name of the issuer of the digital signature certificate |
subjectReference
|
String | Digital Signature Certificate Subject Reference |
Issuer
|
String | Digital Signature Certificate Issuer |
datesConsistency
|
Boolean | Are the start and end dates consistent with the date the document was issued? |
digitalSignature
|
Boolean | Is the digital signature certificate valid? |
Civil servant pay slip
Parameter Name | Type | Description |
documentInfo
|
||
fullName
|
String | name (Full name) of the beneficiary |
employSiret
|
Employer’s SIRET | string |
periodStartDate
|
String | Document Period Start Date |
periodEndDate
|
String | Document Period End Date |
contractStartDate
|
Array | Beneficiary’s contract start date (not often populated) |
netTaxableSalary
|
String | Net Pay of the Month |
netTaxableAccumulatedSalary
|
String | Net Year-to-Date |
certificate
|
||
validityStartDate
|
String | Digital Signature Certificate Validity Start Date |
validityEndDate
|
String | Digital Signature Certificate Validity End Date |
issuerReference
|
String | The issuer reference of the digital signature certificate |
issuerName
|
String | Name of the issuer of the digital signature certificate |
subjectReference
|
String | Digital Signature Certificate Subject Reference |
Issuer
|
String | Digital Signature Certificate Issuer |
datesConsistency
|
Boolean | Are the start and end dates consistent with the date the document was issued? |
digitalSignature
|
Boolean | Is the digital signature certificate valid? |
CAF payment certificate (1 file only)
Parameter Name | Type | Description |
documentInfo
|
||
documentDate
|
String | Document Date |
dateOfBirth
|
String | Recipient’s Date of Birth |
numberOfPages
|
String | Number of pages in the file |
beneficiaryNumberHeader
|
String | Header Assignee Number |
dateHourFooter
|
String | Footer Dates and Times |
barcodeNumber
|
String | Number under the barcode |
barcodeNumberDecoded
|
String | Barcode number decoded |
documentInfoValidation
|
||
datesHeaderFooterValid
|
Boolean | Consistent dates between the header and the footer? |
beneficiaryNumberHeaderFooterValid
|
Boolean | Consistent allocation number between the header and the footer? |
beneficiaryNumberBarcodeNumberValid
|
Boolean | Consistent allocation number between the header and the number under the barcode? |
barcodeNumberBarcodeValid
|
Boolean | Barcode number and decoded barcode number consistent? |
datesHeaderMetasValid
|
Boolean | Dates in the header and in the consistent metas? |
datesFooterMetasValid
|
Boolean | Dates in the footer and in the consistent metas? |
CAF payment certificate (several files)
Parameter Name | Type | Description |
documentInfo
|
||
documentDate
|
String | Document Date |
dateOfBirth
|
String | Recipient’s Date of Birth |
numberOfPages
|
String | Number of pages in the file |
beneficiaryNumberHeader
|
String | Header Assignee Number |
dateHourFooter
|
String | Footer Dates and Times |
barcodeNumber
|
String | Number under the barcode |
barcodeNumberDecoded
|
String | Barcode number decoded |
documentInfoValidation
|
||
datesHeaderFooterValid
|
Boolean | Consistent dates between the header and the footer? |
beneficiaryNumberHeaderFooterValid
|
Boolean | Consistent allocation number between the header and the footer? |
beneficiaryNumberBarcodeNumberValid
|
Boolean | Consistent allocation number between the header and the number under the barcode? |
barcodeNumberBarcodeValid
|
Boolean | Barcode number and decoded barcode number consistent? |
datesHeaderMetasValid
|
Boolean | Dates in the header and in the consistent metas? |
datesFooterMetasValid
|
Boolean | Dates in the footer and in the consistent metas? |
documentsValidation | ||
datesOfBirthValid
|
Boolean | Consistent birth dates across files? |
datesHeaderFooterValid
|
Boolean | Consistent header and footer dates between files? |
beneficiaryNumberHeaderFooterValid
|
Boolean | Consistent header and footer allocation numbers between files? |
beneficiaryNumberBarcodeNumberValid
|
Boolean | Consistent allocation number between the header and the number under the barcode between the files? |
barcodeNumberBarcodeValid
|
Boolean | Barcode number and barcode number decoded consistent between files? |
datesHeaderMetasValid
|
Boolean | Dates in the header and in the consistent metas between files? |
datesFooterMetasValid
|
Boolean | Dates in the footer and in the consistent meta between files? |
editingDateMetasValid
|
Boolean | Is the modification date of the meta tags of the PDF document null? |