Choosing a clinic
Every request reads one clinic. Name it in the Claro-Clinic header when your credential reaches more than one.
One clinic per request#
Each clinic controls its own records. So a request reads one clinic's practitioners, patients or appointments, never a mix.
- An API key reaches exactly one clinic. Leave the header out.
- An OAuth token can reach every clinic its person works at. Send the header on every request.
Find the clinic IDs#
curl https://api-au.claro.clinic/api/public/v1/clinics \
-H "Authorization: Bearer $CLARO_TOKEN"
GET /clinics lists every clinic the credential reaches. It needs no scope and takes no header. Clinics in one organization share an org.id.
Send Claro-Clinic#
curl https://api-au.claro.clinic/api/public/v1/patients \
-H "Authorization: Bearer $CLARO_TOKEN" \
-H "Claro-Clinic: clinic_k3v5tq2m7xw4b6n5r2c6hd3yja"
| Situation | Response |
|---|---|
| Header left out, credential reaches one clinic | That clinic |
| Header left out, credential reaches several | 400 clinic_required, param: "Claro-Clinic" |
| Header names a clinic the credential does not reach | 404 resource_missing, the same as a clinic that does not exist |
| Credential reaches no clinic | 403 no_clinic_access |
The same person at several clinics#
A practitioner's prac_ ID is the same at every clinic. Their membership is not: list practitioners per clinic to see where they work, and whether they prescribe there.
A patient is a different record at each clinic, with a different pat_ ID. Claro never links patients across clinics, and neither should you without each clinic's say-so.