Read, split and pseudonymise a DSN
version_format;source_id;norme;ligne_source;declaration_id;bloc_id;bloc_code;parent_bloc_id;rattache;etablissement_bloc_id;siren;nic;individu_bloc_id;nir;ntt;contrat_bloc_id;numero_contrat;etat_rattachement;rubrique;libelle_rubrique;valeur;libelle_valeur;etat_libelle;source_libelle;article_libelle;empreinte_source;etat_lecture
1;"s1";"P26V01";1;"";"s1:l1";"S10.G00.00";"";"true";"";"";"";"";"";"";"";"";"hors_individu";"S10.G00.00.001";"Nom du logiciel utilisé";"ZAAAA";"";"non_codee";"";"";"";"lisible"
1;"s1";"P26V01";2;"";"s1:l1";"S10.G00.00";"";"true";"";"";"";"";"";"";"";"";"hors_individu";"S10.G00.00.002";"Nom de l'éditeur";"YAAAA";"";"non_codee";"";"";"";"lisible"
1;"s1";"P26V01";3;"";"s1:l1";"S10.G00.00";"";"true";"";"";"";"";"";"";"";"";"hors_individu";"S10.G00.00.005";"Code envoi du fichier d'essai ou réel";"01";"envoi fichier test";"publie";"datatypes-2026.xlsx";"Data Types!H22";"adb774b4ee7c584ecf359f20564106490c00ba97b2717ae4d47e11dbaf9d8af8";"lisible"
1;"s1";"P26V01";4;"";"s1:l1";"S10.G00.00";"";"true";"";"";"";"";"";"";"";"";"hors_individu";"S10.G00.00.006";"Numéro de version de la norme utilisée";"P26V01";"Année 2026 Version 1";"publie";"datatypes-2026.xlsx";"Data Types!H83";"adb774b4ee7c584ecf359f20564106490c00ba97b2717ae4d47e11dbaf9d8af8";"lisible"
1;"s1";"P26V01";5;"";"s1:l1";"S10.G00.00";"";"true";"";"";"";"";"";"";"";"";"hors_individu";"S10.G00.00.007";"Point de dépôt";"01";"Net-entreprises";"publie";"datatypes-2026.xlsx";"Data Types!H84";"adb774b4ee7c584ecf359f20564106490c00ba97b2717ae4d47e11dbaf9d8af8";"lisible"
1;"s1";"P26V01";6;"";"s1:l1";"S10.G00.00";"";"true";"";"";"";"";"";"";"";"";"hors_individu";"S10.G00.00.008";"Type de l'envoi";"01";"envoi normal";"publie";"datatypes-2026.xlsx";"Data Types!H76";"adb774b4ee7c584ecf359f20564106490c00ba97b2717ae4d47e11dbaf9d8af8";"lisible"
1;"s1";"P26V01";7;"";"s1:l7";"S10.G00.01";"s1:l1";"true";"";"";"";"";"";"";"";"";"hors_individu";"S10.G00.01.001";"Siren de l'émetteur de l'envoi";"900000019";"";"non_codee";"";"";"";"lisible"
1;"s1";"P26V01";8;"";"s1:l7";"S10.G00.01";"s1:l1";"true";"";"";"";"";"";"";"";"";"hors_individu";"S10.G00.01.002";"Nic de l'émetteur de l'envoi";"00019";"";"non_codee";"";"";"";"lisible"
1;"s1";"P26V01";9;"";"s1:l7";"S10.G00.01";"s1:l1";"true";"";"";"";"";"";"";"";"";"hors_individu";"S10.G00.01.003";"Nom ou raison sociale de l'émetteur";"ZAAAA";"";"non_codee";"";"";"";"lisible"
1;"s1";"P26V01";10;"";"s1:l7";"S10.G00.01";"s1:l1";"true";"";"";"";"";"";"";"";"";"hors_individu";"S10.G00.01.005";"Code postal";"75001";"";"source_absente";"NEODESP26_P26V01_NEODESP26_CUMUL_P26V01.csv";"HEX ; ligne 138071";"d1dec1e071bdc764bf1cea9b8fbfaf5603ff4497bfec5c792ae17499b16b80f0";"lisible"
1;"s1";"P26V01";11;"";"s1:l7";"S10.G00.01";"s1:l1";"true";"";"";"";"";"";"";"";"";"hors_individu";"S10.G00.01.006";"Localité";"VAAA";"";"non_codee";"";"";"";"lisible"dsnlint-connect extraire mensuelle-complete.dsn --option par=rubrique --option document=csvThe fields of a DSN, line by line. The excerpt shows the header of a CSV with 331 lines and 27 columns, then the first fields with their official label and declared value. The value label and its source are given where published: code 01 here means “envoi fichier test”, with its source in the official data-types table.
Excerpts from a real DSNLint API response, received with DSNLint Connect 1.3.0 on 5 December 2026, for public examples with fictitious data: mensuelle-complete.dsn. Engine outputs are in French. The same request sent with curl returns the same document, byte for byte.Three tools, one DSN
- Every field as CSVOne line per occurrence, with the declared value and its official label where one exists; no value is converted.
- Each line traced to its DSN sourceThe block, the source line, the individual and the contract are given; a shared payment is never attributed to the last contract read.
- One or several individualsSelect individuals (everyone declared: employees, apprentices, interns, corporate officers…) by NIR, payroll number or NTT. The CSV is for analysis, never for filing. If an individual is missing, the whole extraction is rejected.
- A damaged DSNTo analyse a damaged DSN, the tolerant option of extraction by field returns the unreadable lines explicitly; it is not available when extracting individuals.
- Files by establishmentDeclarations of the same establishment (SIREN and NIC), edition of the standard and compatible envelope are grouped in one DSN file; an incompatible envelope gives another file, and no declaration is merged.
- Each file is checkedThe input is checked before splitting, and each output file is checked before delivery. Input with a blocking anomaly is rejected, never corrected.
- Consistent fictitious identitiesNames, first names, addresses, NIR, payroll numbers and contracts are replaced; the same value gets the same pseudonym throughout.
- The same check resultThe diagnostics for the pseudonymised file set are compared with those for the source before delivery. Any difference causes the whole set to be rejected.
- Your key, your pseudonymsWith your private key, the same files give the same pseudonyms; without a key, each call draws new ones.
In the application
- Splitting by establishment: the area for the DSN files and the button that splits them
- Pseudonymisation: the alert that the data are pseudonymised, not anonymous, the area for the DSN files and the button that pseudonymises them
April’s DSN, one file per establishment
manifeste.json
morceau-00000001.dsn
morceau-00000002.dsn{
"$schema": "urn:intek-center:dsnlint:decoupage:manifeste:10",
"document": "decoupage",
"fichiers": [
{
"id": "f1",
"nom": "avril-2026.dsn",
"origine_empreinte": "disponible",
"origine_nom": "declaree",
"raison": null,
"role": "dsn",
"sha256": "e7bf7cc84029dc7fb6e33c86267ad69d84acd3b8e6407e1f9f8155765878c893"
}
],
"moteur": {
"nom": "dsnlint",
"version": "1.3.0"
},
"normes": [
"P26V01"
],
"options": {
"annee_controle": 2026,
"fils": 1,
"masquer_comptes": false,
"max_decompresse": 2147483648,
"max_entrees": 100000,
"par": "etablissement"
},
"resultat": {
"declarations_neant": 0,
"individus_source": 15,
"limites": [
"Les données source sont conservées dans les morceaux.",
"Les faits collectifs sans affectation individuelle prouvée entraînent un refus.",
"La validité contrôlée ne certifie pas les référentiels externes non embarqués."
],
"mode": "decouper_etablissement",
"parametres": {
"fils_maximum": 1,
"max_decompresse": 2147483648,
"max_entrees": 100000
},
"provenance_sources": [
{
"declarations": 2,
"lignes": 3221,
"millesime": "P26V01",
"octets": 77253,
"rang": 1
}
],
"sorties": [
{
"avertissements": [],
"declarations": 1,
"individus": 8,
"lignes": 1714,
"lignes_contexte": 16,
"millesime": "P26V01",
"nature_partition": "etablissement",
"octets": 41149,
"rang_sortie": 1,
"rang_source": 1,
"rangs_source": [
1
],
"segments_source": [
{
"debut": 1,
"debut_sortie": 1,
"fin": 1713,
"rang_source": 1
}
],
"sha256": "93cdd7ae280b7e6d28165e0c9d4fee3600430f41d264a7619d841814f2ac2569"
},
{
"avertissements": [],
"declarations": 1,
"individus": 7,
"lignes": 1525,
"lignes_contexte": 16,
"millesime": "P26V01",
"nature_partition": "etablissement",
"octets": 36608,
"rang_sortie": 2,
"rang_source": 1,
"rangs_source": [
1S10.G00.00.001,'Gestion salariale'
S10.G00.00.002,'Bureau des Rives'
S10.G00.00.005,'01'
S10.G00.00.006,'P26V01'
S10.G00.00.007,'01'
S10.G00.00.008,'01'
S10.G00.01.001,'732829320'
S10.G00.01.002,'00074'
S10.G00.01.003,'Bureau des Deux Rives'
S10.G00.01.004,'18 RUE DES DOSSIERS'
S10.G00.01.005,'75011'
S10.G00.01.006,'PARIS'
S10.G00.02.001,'01'
S10.G00.02.002,'Service des remunerations'
S10.G00.02.004,'remunerations@example.invalid'
S10.G00.02.005,'0100000000'
S20.G00.05.001,'01'
S20.G00.05.002,'01'
S20.G00.05.003,'11'
S20.G00.05.004,'1'
S20.G00.05.005,'01042026'
S20.G00.05.007,'05052026'
S20.G00.05.008,'01'
S20.G00.05.010,'01'
S21.G00.06.001,'732829320'
S21.G00.06.002,'00074'
S21.G00.06.003,'8211Z'
S21.G00.06.004,'18 RUE DES DOSSIERS'
S21.G00.06.005,'75011'
S21.G00.06.006,'PARIS'
S21.G00.11.001,'00074'
S21.G00.11.002,'8211Z'
S21.G00.11.003,'18 RUE DES DOSSIERS'
S21.G00.11.004,'75011'
S21.G00.11.005,'PARIS'
S21.G00.11.017,'01'
S21.G00.11.022,'2098'
S21.G00.11.023,'07'
S21.G00.15.001,'SANTE-COLLECTIVE'
S21.G00.15.002,'P0002'
S21.G00.15.004,'01'
S21.G00.15.005,'1'
S21.G00.20.001,'75357004300012'
S21.G00.20.003,'ZZZZFRPP'
S21.G00.20.004,'FR7600000000000000000000097'
S21.G00.20.005,'9956.00'
S21.G00.20.006,'01042026'
S21.G00.20.007,'30042026'
S21.G00.20.010,'05'
S21.G00.20.001,'77568291700015'
S21.G00.20.003,'ZZZZFRPP'
S21.G00.20.004,'FR7600000000000000000000097'
S21.G00.20.005,'2244.29'
S21.G00.20.006,'01042026'
S21.G00.20.007,'30042026'
S21.G00.20.010,'05'
S21.G00.20.001,'P0002'
S21.G00.20.003,'ZZZZFRPP'
S21.G00.20.004,'FR7600000000000000000000097'
S21.G00.20.005,'640.00'
S21.G00.20.006,'01042026'
S21.G00.20.007,'30042026'
S21.G00.20.010,'05'
S21.G00.55.001,'640.00'
S21.G00.55.003,'SANTE-COLLECTIVE'
S21.G00.55.004,'2026M04'
S21.G00.20.001,'DGFIP'
S21.G00.20.002,'DGFIP_PAS'
S21.G00.20.003,'ZZZZFRPP'
S21.G00.20.004,'FR7600000000000000000000097'
S21.G00.20.005,'964.00'
S21.G00.20.006,'01042026'
S21.G00.20.007,'30042026'
S21.G00.20.010,'05'
S21.G00.22.001,'75357004300012'
S21.G00.22.003,'01042026'
S21.G00.22.004,'30042026'
S21.G00.22.005,'9956.00'
S21.G00.23.001,'100'
S21.G00.23.002,'920'
S21.G00.23.003,'1.00'
S21.G00.23.004,'23850.00'
S21.G00.23.001,'100'
S21.G00.23.002,'921'
S21.G00.23.004,'22060.00'
S21.G00.23.001,'260'
S21.G00.23.002,'920'
S21.G00.23.004,'23753.00'
S21.G00.23.001,'332'
S21.G00.23.002,'921'S10.G00.00.001,'Gestion salariale'
S10.G00.00.002,'Bureau des Rives'
S10.G00.00.005,'01'
S10.G00.00.006,'P26V01'
S10.G00.00.007,'01'
S10.G00.00.008,'01'
S10.G00.01.001,'732829320'
S10.G00.01.002,'00074'
S10.G00.01.003,'Bureau des Deux Rives'
S10.G00.01.004,'18 RUE DES DOSSIERS'
S10.G00.01.005,'75011'
S10.G00.01.006,'PARIS'
S10.G00.02.001,'01'
S10.G00.02.002,'Service des remunerations'
S10.G00.02.004,'remunerations@example.invalid'
S10.G00.02.005,'0100000000'
S20.G00.05.001,'01'
S20.G00.05.002,'01'
S20.G00.05.003,'11'
S20.G00.05.004,'2'
S20.G00.05.005,'01042026'
S20.G00.05.007,'05052026'
S20.G00.05.008,'01'
S20.G00.05.010,'01'
S21.G00.06.001,'732829320'
S21.G00.06.002,'00074'
S21.G00.06.003,'8211Z'
S21.G00.06.004,'18 RUE DES DOSSIERS'
S21.G00.06.005,'75011'
S21.G00.06.006,'PARIS'
S21.G00.11.001,'00082'
S21.G00.11.002,'8211Z'
S21.G00.11.003,'27 RUE DES REGISTRES'
S21.G00.11.004,'69003'
S21.G00.11.005,'LYON'
S21.G00.11.017,'01'
S21.G00.11.022,'2098'
S21.G00.11.023,'07'
S21.G00.15.001,'SANTE-COLLECTIVE'
S21.G00.15.002,'P0002'
S21.G00.15.004,'01'
S21.G00.15.005,'1'
S21.G00.20.001,'75357004300012'
S21.G00.20.003,'ZZZZFRPP'
S21.G00.20.004,'FR7600000000000000000000097'
S21.G00.20.005,'5583.37'
S21.G00.20.006,'01042026'
S21.G00.20.007,'30042026'
S21.G00.20.010,'05'
S21.G00.20.001,'77568291700015'
S21.G00.20.003,'ZZZZFRPP'
S21.G00.20.004,'FR7600000000000000000000097'
S21.G00.20.005,'1062.36'
S21.G00.20.006,'01042026'
S21.G00.20.007,'30042026'
S21.G00.20.010,'05'
S21.G00.20.001,'P0002'
S21.G00.20.003,'ZZZZFRPP'
S21.G00.20.004,'FR7600000000000000000000097'
S21.G00.20.005,'560.00'
S21.G00.20.006,'01042026'
S21.G00.20.007,'30042026'
S21.G00.20.010,'05'
S21.G00.55.001,'560.00'
S21.G00.55.003,'SANTE-COLLECTIVE'
S21.G00.55.004,'2026M04'
S21.G00.20.001,'DGFIP'
S21.G00.20.002,'DGFIP_PAS'
S21.G00.20.003,'ZZZZFRPP'
S21.G00.20.004,'FR7600000000000000000000097'
S21.G00.20.005,'275.00'
S21.G00.20.006,'01042026'
S21.G00.20.007,'30042026'
S21.G00.20.010,'05'
S21.G00.22.001,'75357004300012'
S21.G00.22.003,'01042026'
S21.G00.22.004,'30042026'
S21.G00.22.005,'5583.00'
S21.G00.23.001,'100'
S21.G00.23.002,'920'
S21.G00.23.003,'1.00'
S21.G00.23.004,'14438.00'
S21.G00.23.001,'100'
S21.G00.23.002,'921'
S21.G00.23.004,'14438.00'
S21.G00.23.001,'260'
S21.G00.23.002,'920'
S21.G00.23.004,'14466.00'
S21.G00.23.001,'332'
S21.G00.23.002,'921'dsnlint-connect decouper avril-2026.dsn --option par=etablissementSame fictitious company as the report on the DSN standard check page, Bureau des Deux Rives. As the manifest says, “les données source sont conservées dans les morceaux” (the source data is kept in the output files): splitting pseudonymises nothing.
Excerpts from a real DSNLint API response, received with DSNLint Connect 1.3.0 on 5 December 2026, for public examples with fictitious data: avril-2026.dsn. Engine outputs are in French. The same request sent with curl returns the same document, byte for byte.January’s DSN, pseudonymised
S21.G00.30.001,'2820375056801'
S21.G00.30.002,'MOREAU'
S21.G00.30.004,'CLAIRE'
S21.G00.30.005,'02'
S21.G00.30.006,'14031982'
S21.G00.30.001,'1750969123802'
S21.G00.30.002,'GARNIER'
S21.G00.30.004,'LUC'
S21.G00.30.005,'01'
S21.G00.30.006,'22091975'
S21.G00.30.001,'2930731555803'
S21.G00.30.002,'PERRIN'manifeste.json
pseudonyme-00000001.dsnS21.G00.30.001,'2820375817111'
S21.G00.30.002,'UWLVRT'
S21.G00.30.004,'ONSXWR'
S21.G00.30.005,'02'
S21.G00.30.006,'14031982'
S21.G00.30.001,'1750969595304'
S21.G00.30.002,'ODNKYOV'
S21.G00.30.004,'XZQ'
S21.G00.30.005,'01'
S21.G00.30.006,'22091975'
S21.G00.30.001,'2930731881501'
S21.G00.30.002,'XHEWHK'dsnlint-connect pseudonymiser janvier-2026.dsn --cle-pseudonymisation-fichier cle-fictive.binSame fictitious company as the report on the DSN standard check page, Bureau des Deux Rives, with the fictitious key cle-fictive.bin, the same as in the pseudonymisation example further down. The pseudonymised DSN keeps the source’s 3,221 lines but cannot be filed, as the section “What these tools do not do” says.
Excerpts from a real DSNLint API response, received with DSNLint Connect 1.3.0 on 5 December 2026, for public examples with fictitious data: janvier-2026.dsn, cle-fictive.bin. Engine outputs are in French. The same request sent with curl returns the same document, byte for byte.A DSN split by establishment
manifeste.json
morceau-00000001.dsn{
"$schema": "urn:intek-center:dsnlint:decoupage:manifeste:10",
"document": "decoupage",
"fichiers": [
{
"id": "f1",
"nom": "mensuelle-complete.dsn",
"origine_empreinte": "disponible",
"origine_nom": "declaree",
"raison": null,
"role": "dsn",
"sha256": "3dc07e40edc864e032293e6ad55779146ec8be97f23bbabab6b8ce986fec701f"
}
],
"moteur": {
"nom": "dsnlint",
"version": "1.3.0"
},
"normes": [
"P26V01"
],
"options": {
"annee_controle": 2026,
"fils": 1,
"masquer_comptes": false,
"max_decompresse": 2147483648,
"max_entrees": 100000,
"par": "etablissement"
},
"resultat": {dsnlint-connect decouper mensuelle-complete.dsn --option par=etablissementThe manifest follows a version 10 schema; it names the source file with its SHA-256 fingerprint, the P26V01 standard and the API option “par”, set to “etablissement”.
Excerpts from a real DSNLint API response, received with DSNLint Connect 1.3.0 on 5 December 2026, for public examples with fictitious data: mensuelle-complete.dsn. Engine outputs are in French. The same request sent with curl returns the same document, byte for byte.Identities before and after
S21.G00.30.001,'1900175001001'
S21.G00.30.002,'ZAAAAAB'
S21.G00.30.004,'YAAAAAB'
S21.G00.30.005,'01'
S21.G00.30.006,'01011990'
S21.G00.30.001,'2900175001002'
S21.G00.30.002,'ZAAAAAC'
S21.G00.30.004,'YAAAAAC'
S21.G00.30.005,'02'
S21.G00.30.006,'01011990'
S21.G00.30.001,'1900175001003'
S21.G00.30.002,'ZAAAAAD'manifeste.json
pseudonyme-00000001.dsnS21.G00.30.001,'1900175607567'
S21.G00.30.002,'HOYVJXE'
S21.G00.30.004,'KCGMXZC'
S21.G00.30.005,'01'
S21.G00.30.006,'01011990'
S21.G00.30.001,'2900175768037'
S21.G00.30.002,'HOYVJXF'
S21.G00.30.004,'KCGMXZD'
S21.G00.30.005,'02'
S21.G00.30.006,'01011990'
S21.G00.30.001,'1900175607569'
S21.G00.30.002,'HOYVJXG'dsnlint-connect pseudonymiser mensuelle-complete.dsn \
--cle-pseudonymisation-fichier cle-fictive.binNames and first names change; the NIR (the French social security number) changes too, except its first seven digits (sex, year, month, département). Sex (01 or 02) and date of birth (01011990) are kept.
Excerpts from a real DSNLint API response, received with DSNLint Connect 1.3.0 on 5 December 2026, for public examples with fictitious data: mensuelle-complete.dsn, cle-fictive.bin. Engine outputs are in French. The same request sent with curl returns the same document, byte for byte.Through the API, from the command line or from an assistant
curl -X POST "$DSNLINT_API_URL/v1/extractions" \
-H "Authorization: Bearer $DSNLINT_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-F 'manifeste={"version":1,"fonction":"extraire","options":{"par":"rubrique","document":"csv"},"pieces":[{"id":"p0","role":"dsn","nom":"mensuelle-complete.dsn","taille":7643}]};type=application/json' \
-F 'p0=@mensuelle-complete.dsn;filename=mensuelle-complete.dsn' \
-o extraction.csvimport { readFile, writeFile } from "node:fs/promises";
import { randomUUID } from "node:crypto";
const headers = {
"Authorization": "Bearer " + process.env.DSNLINT_API_KEY,
"Idempotency-Key": randomUUID(),
};
const form = new FormData();
form.append("p0", new Blob([await readFile("mensuelle-complete.dsn")], { type: "application/octet-stream" }), "mensuelle-complete.dsn");
const encoded = new Response(form);
headers["Content-Type"] = encoded.headers.get("Content-Type");
const boundary = headers["Content-Type"].split("boundary=")[1];
const body = new Blob([
`--${boundary}\r\nContent-Disposition: form-data; name="manifeste"\r\nContent-Type: application/json\r\n\r\n`,
"{\"version\":1,\"fonction\":\"extraire\",\"options\":{\"par\":\"rubrique\",\"document\":\"csv\"},\"pieces\":[{\"id\":\"p0\",\"role\":\"dsn\",\"nom\":\"mensuelle-complete.dsn\",\"taille\":7643}]}", "\r\n", await encoded.arrayBuffer(),
]);
const response = await fetch(process.env.DSNLINT_API_URL + "/v1/extractions", {
method: "POST", headers, body, signal: AbortSignal.timeout(120000),
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
await writeFile("extraction.csv", new Uint8Array(await response.arrayBuffer()));import os
import uuid
import urllib.request
headers = {
"Authorization": "Bearer " + os.environ["DSNLINT_API_KEY"],
"Idempotency-Key": str(uuid.uuid4()),
}
boundary = "dsnlint-" + str(uuid.uuid4())
headers["Content-Type"] = "multipart/form-data; boundary=" + boundary
chunks = [
("--" + boundary + '\r\nContent-Disposition: form-data; name="manifeste"\r\nContent-Type: application/json\r\n\r\n').encode(),
"{\"version\":1,\"fonction\":\"extraire\",\"options\":{\"par\":\"rubrique\",\"document\":\"csv\"},\"pieces\":[{\"id\":\"p0\",\"role\":\"dsn\",\"nom\":\"mensuelle-complete.dsn\",\"taille\":7643}]}".encode("utf-8"), b"\r\n",
]
chunks.append(("--" + boundary + "\r\nContent-Disposition: form-data; name=\"p0\"; filename=\"mensuelle-complete.dsn\"\r\nContent-Type: application/octet-stream\r\n\r\n").encode())
with open("mensuelle-complete.dsn", "rb") as source:
chunks.extend([source.read(), b"\r\n"])
chunks.append(("--" + boundary + "--\r\n").encode())
body = b"".join(chunks)
request = urllib.request.Request(os.environ["DSNLINT_API_URL"] + "/v1/extractions",
data=body, headers=headers, method="POST")
with urllib.request.urlopen(request, timeout=120) as response:
if not 200 <= response.status < 300:
raise RuntimeError(f"HTTP {response.status}")
with open("extraction.csv", "wb") as output:
output.write(response.read())<?php
$headers = [
'Authorization: Bearer ' . getenv('DSNLINT_API_KEY'),
'Idempotency-Key: ' . bin2hex(random_bytes(16)),
];
$boundary = "dsnlint-" . bin2hex(random_bytes(16));
$headers[] = "Content-Type: multipart/form-data; boundary=" . $boundary;
$body = "--$boundary\r\nContent-Disposition: form-data; name=\"manifeste\"\r\nContent-Type: application/json\r\n\r\n"
. '{"version":1,"fonction":"extraire","options":{"par":"rubrique","document":"csv"},"pieces":[{"id":"p0","role":"dsn","nom":"mensuelle-complete.dsn","taille":7643}]}' . "\r\n";
$files = [
'p0' => new CURLFile('mensuelle-complete.dsn', 'application/octet-stream', 'mensuelle-complete.dsn'),
];
foreach ($files as $name => $file) {
$bytes = file_get_contents($file->getFilename());
if ($bytes === false) { exit(1); }
$body .= "--$boundary\r\nContent-Disposition: form-data; name=\"$name\"; filename=\""
. $file->getPostFilename() . "\"\r\nContent-Type: " . $file->getMimeType()
. "\r\n\r\n" . $bytes . "\r\n";
}
$body .= "--$boundary--\r\n";
$curl = curl_init(getenv('DSNLINT_API_URL') . '/v1/extractions');
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_HTTPHEADER => $headers,
CURLOPT_POSTFIELDS => $body, CURLOPT_RETURNTRANSFER => true,
CURLOPT_CONNECTTIMEOUT => 10, CURLOPT_TIMEOUT => 120,
]);
$response = curl_exec($curl);
$status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE);
if ($response === false || $status < 200 || $status >= 300) {
fwrite(STDERR, "HTTP $status\n");
exit(1);
}
if (file_put_contents('extraction.csv', $response) === false) { exit(1); }A plain HTTP request: your key in the Authorization header, an idempotency key, then the file. If you resend an identical request already processed with the same idempotency key, the API returns 204 for 900 seconds at most: the request is neither recomputed nor counted again.
What these tools do not do
- Extraction does not spread collective amounts across individuals and invents no proration.
- Splitting gives no new authorisation to file: the output files are for analysis and local sharing.
- A pseudonymised DSN cannot be filed and is not anonymous: its amounts, dates and categories mean it remains personal data under the GDPR.
- None of these tools repairs a DSN: splitting rejects input with a blocking anomaly, and extraction is rejected in full if an individual is missing.
- Pseudonymisation keeps no table linking the real identities to the pseudonyms.
Related functions
Formats and exports
The same report in 8 formats, through the API and through DSNLint Connect, each for its own useDSN standard check
The verdict on each DSN, every anomaly and, on request, its fix and its sourceHR statements
HR statements, thresholds, BDESE, social report, draft staff register, portfolio