Accessing Lifen's APIs in Machine To Machine involves obtaining an Access Token with the Client credentials grant flow of OAuth 2.0 from a back-end server.
A request to Lifen must be perfomed to generate an access token. In the request, the client has to provide his credentials and some configuration.
Here is a request example:
curl --request POST \ --url 'https://login.public.post-prod.lifen.fr/oauth/token' \ --data 'client_id=clientidclientidclientid' \ --data 'client_secret=clientsecretclientsecret' \ --data 'audience=https://post-prod.platform-apis/' \ --data 'database_reference=KA5hEDzf73' \ --data 'grant_type=client_credentials'
The following parameters are important:
client_id, which you obtain from your account manager
client_secret, which you obtain from your account manager
audienceis the domain where your access token is available
database_referencewhich you obtain from your account manager, is the identifier connecting your application with a healthcare organization
grant_typeallows you to request server to server Lifen's API
You will get an HTTP 200 response with a payload containing the
The Access Token allows you to make requests to the API on the behalf of the client. Each request must include the Access Token in
the Authorization header using the Bearer format.
curl -H "Authorization: Bearer $ACCESS_TOKEN" https://api.lifen.fr/fhir/v3/$endpoint
Updated 7 months ago