Overview - SocialGouv/code-du-travail-backoffice GitHub Wiki
Overview
The current API is generated via PostgREST v6.
Schema
All API access is over HTTPS, and accessed from https://contributions-api.codedutravail.fabrique.social.gouv.fr
. All data is received as JSON.
curl https://contributions-api.codedutravail.fabrique.social.gouv.fr/RESOURCE_NAME
Authentication
The public API doesn't require any authentication.
Parameters
To understand how to use the paramaters in order to filter and customize the responses, here are the important things to know from PostgREST documentation:
⚠️ Important Tables joining (or resource embedding) only concerns one-to-one/many relationships and may have a serious impact on performances. In which case it would be preferable to make multiple separate calls instead and re-conciliate the data afterwards within your code.
⚠️ Known Issue Resource embedding with embedded row filters seems to be very unstable, thus unsafe to use in a production environment. It's better to get the id separately from another call and use it as a root row filter. It's also faster.
Helpers
I wrote a tiny library in order to ease the Javascript integration of PostgREST url parameters.