@socialgouv/dila-api-client
![NPM](https://nodei.co/npm/@socialgouv/dila-api-client.png?downloads=true&downloadRank=true&stars=true)
![renovate](https://badges.renovateapi.com/github/SocialGouv/dila-api-client)
This JS package helps querying the DILA API
Usage
You need to set two environment variables : OAUTH_CLIENT_ID
and OAUTH_CLIENT_SECRET
.
These variables are the "oauth identifier" defined in your custom application in the AIFE portal
Envs
Récupérer la table des matières d'un code
const DilaApiClient = require("@socialgouv/dila-api-client");
const dilaApi = new DilaApiClient();
dilaApi
.fetch({
path: "consult/code/tableMatieres",
method: "POST",
params: {
date: new Date().getTime(),
sctId: "",
textId: "LEGITEXT000006072050",
},
})
.then(console.log);
dilaApi
.fetch({
path: "list/code",
method: "POST",
})
.then(console.log);
See also ./examples
Debug
you need to set the DEBUG=*
environment variable in order to see
the output of inner logs.
Release policy
Releases are automaticly made through our GitHub Actions strictly following the Semantic Versioning specification thanks to semantic-release.