Resources in the Synchronizer API relate to each other. This page shows how to query those relationships.
Two example questions are "What procedures were performed in an appointment?" and "What payments has a patient made?" There are two ways to answer questions like these: the include parameter and filtering.
The include parameter
Use the include parameter to answer the first question. Add include[]=procedures as a query parameter on a request for one appointment. The response returns the appointment with the procedures performed in it.
Fill in your subdomain, appointment ID and bearer token.
curl --request GET \
--url 'https://nexhealth.info/appointments/YOUR_APPOINTMENT_ID?subdomain=YOUR_SUBDOMAIN&include\[\]=procedures' \
--header 'Nex-Api-Version: v3.0.0' \
--header 'Authorization: Bearer YOUR_BEARER_TOKEN'In v3.0.0, include works on the endpoint for a single record, such as GET /appointments/{id}. Most list endpoints, including GET /appointments, do not accept it. The reference page for each endpoint lists the values it accepts.
Filtering
Use filtering to answer the second question. Send a request to the payments endpoint with patient_id as a query parameter. The response lists the payments that patient made.
Fill in your subdomain, location ID, bearer token and the patient ID to filter for.
curl --request GET \
--url 'https://nexhealth.info/payments?subdomain=YOUR_SUBDOMAIN&location_id=YOUR_LOCATION_ID&patient_id=YOUR_PATIENT_ID&per_page=5' \
--header 'Nex-Api-Version: v3.0.0' \
--header 'Authorization: Bearer YOUR_BEARER_TOKEN'The response is paginated. See Pagination.