Sample apps

Three complete apps built from the guides: a booking widget, an AI receptionist and payment posting.

AppWhat it doesLanguageGuides it uses
Booking widgetA web page that shows open times, takes the patient's details and books. Confirms the booking from the appointment_insertion webhook.Node, no packagesScheduling quickstart, Patients quickstart, Setting up webhooks
AI receptionistA text conversation that finds the caller, offers open times and books once they say yes. A language model runs the conversation and calls four functions over the API.PythonScheduling quickstart, Patients configuration guide
Payment postingA command that applies a payment to the patient's oldest charges, posts it to the ledger and waits for it to appear.Node, no packagesPayments quickstart, Payments configuration guide

What they have in common

  • One place for credentials. Each app reads NEX_API_KEY, NEX_SUBDOMAIN and NEX_LOCATION_ID from the environment and trades the key for a bearer token itself. Tokens last 1 hour in production, so the two apps that keep running refresh theirs after 50 minutes.
  • Every call goes through one function that sets Nex-Api-Version, adds the token, and turns code: false into an error with the API's own message.
  • A write is not done at 201 or 202. The widget waits for appointment_insertion. The payment app polls GET /payments by transaction_id. See How a write reaches the health record system.
  • No duplicate patients. The widget creates with return_existing_if_match, so a returning patient gets their existing record. The receptionist searches by phone and books only a patient it found.

Before you run one

  1. Get a sandbox key, subdomain and location ID from the Quickstart.
  2. Set the environment variables each page lists.
  3. Run the app against the sandbox first. Switch NEX_API_KEY to a production key only after the Go-live checklist.

The apps use a stand-in NEX_BASE variable for the API host, so you can point them at a local test server. Leave it unset to call https://nexhealth.info.


Did this page help you?