--- title: "Show Doctor's Availability" description: "Find available timeslots for booking by listing care units, resources, healthcare services, and open time windows." canonical_url: "http://localhost/api/quickstart/show-availability" --- # Show Doctor's Availability > Find available timeslots for booking by listing care units, resources, healthcare services, and open time windows. Learn how to discover available timeslots for booking appointments. This guide walks through the complete flow from finding care units to checking doctor availability. ## Flow Overview ![Show Doctor's Availability Flow](http://localhost/images/quickstart/show-availability.png) ## Understanding the Concepts Before diving into code, let's understand the key concepts: - **Care Units**: Physical locations where healthcare is provided (e.g., "Main Clinic", "Downtown Office") - **Resources**: People or equipment that can be scheduled (e.g., "Dr. Smith", "MRI Machine") - **Healthcare Services**: Types of appointments offered (e.g., "General Consultation", "Follow-up Visit") - **Timeslots**: Available time windows when a resource can be booked ## Code Example ### Shared setup #### 1. Get care units #### 2. Get resources #### 3. Get healthcare services #### 4. Get available timeslots #### 5. Display a few results ## Key Insights ### Working with IDs Leyr uses two types of identifiers throughout the API: - **id** - Leyr's internal identifier. **Always use this for API requests** (booking appointments, filtering timeslots, etc.) - **emr_id** - The original EHR system's identifier. This is provided for informational purposes and debugging with the EHR, but should not be used in Leyr API calls For example, when booking an appointment, use `resource.id` and `service.id`, not `resource.emr_id`. ## Filtering Results You can filter timeslots by resource, service, or both: ## Next steps Create appointments using a found timeslot and a patient. ## API Reference For detailed API documentation, see: - [Care Units API](https://api.leyr.io/docs#tag/Care-Units) - [Resources API](https://api.leyr.io/docs#tag/Resources) - [Healthcare Services API](https://api.leyr.io/docs#tag/Healthcare-Services) - [Timeslots API](https://api.leyr.io/docs#tag/Timeslots) ## Sitemap See the full [sitemap](http://localhost/sitemap.md) for all pages.