0.0.3 • Published 5 years ago

dila-api-client v0.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

dila-api-client

This JS package helps querying the DILA API

Usage

You need to set two envrionment variables : OAUTH_CLIENT_ID and OAUTH_CLIENT_SECRET.

These variables are the "oauth identifier" defined in your custom application in the AIFE portal

Récupérer la table des matières d'un code

const DilaApiClient = require("dila-api-client");

const dilaApi = new DilaApiClient();

dilaApi.fetchCodeTableMatieres({
  date: new Date().getTime(),
  sctId: "",
  textId: "LEGITEXT000006072050"
}).then(console.log)

Other API calls

dilaApi.apiFetch({
  path: 'dila/legifrance/lf-engine-app/list/code'
  method: 'POST,
  params: {
    test: 42
  }
}).then(console.log)

Debug

you need to set the DEBUG=dila-api-client environment variable in order to see the output of inner logs.