---
title: "Get Available Times"
method: GET
path: "/consumer/v1/availability/{serviceId}/{startDate}/{endDate}"
tags: ["Availability"]
---

# Get Available Times

`GET /consumer/v1/availability/{serviceId}/{startDate}/{endDate}`

**Choose your search criteria carefully. Availability is an expensive call.** If you search availability for all resources, you should only do so for a single date. If you search availability for multiple dates, you should only do so for a specific resource by specifying the optional resourceId parameter.

A **serviceId** is required. The **startDate** and **endDate** are required and are formatted as: **YYYY-MM-DD**

A **resourceId** is optional, it is recommended if known at the time of availability call.

**timezoneName** is optional, it allows you to specify the IANA formatted name for the end user's timezone to view availability. e.g., _America/New\_York_. **NOTE: This is the recommended approach for your implementation.** The "tzOffset" parameter remains for backward compatibility. For JavaScript, use moment.js in your client for ease of timezone detection and selection. For iOS, use the name property of the NSTimeZone returned from the localTimeZone method. For .NET, consider NodaTime or TimeZoneConverter via NuGet.

**duration** should only be populated if you allow the end user to select a duration, otherwise the service's duration will be used.

**startTime** and **endTime** are optional and are specified in **military time e.g., 800 = 8:00am, 2230 = 10:30pm**. Note: You will only see availability within the boundary of your business location start and end times.

**dayAvailability** will return day level availability for the number of days requested from the start date. See _GET /consumer/v1/availability/{serviceId}/{startDate}/{endDate}/days_ for details.

**firstDayAvailable** only works with day availability. If set to true it will look for the first day available within the range specified by the dayAvailability parameter. The two parameters together can be a clever way to display availability for a week or month. Tip - pass in the beginning of the week or month, and available times are displayed for the first available date if exists.

**tzOffset** allows you to pass in the timezone offset for the end user's timezone of choice, e.g., (-240) for EST. If you use this option, your application should be timezone aware. The requested timezone is specified as an offset (plus or minus) from GMT time.

Availability can be complex. For further troubleshooting refer to the: _**GET /consumer/v1/availability/{serviceId}/{startDate}/{endDate}/unavailable**_ endpoint. This endpoint will show you all unavailable times for a given date range. Available times are created from any unblocked time periods. For more information: [Availability Overview](https://onsched.readme.io/docs/availability-overview)

## Path parameters

- `serviceId` string, required
- `startDate` string, date-time, required
- `endDate` string, date-time, required

## Query parameters

- `startTime` integer
- `endTime` integer
- `locationId` string
- `resourceId` string
- `resourceGroupId` string
- `resourceIds` string
- `roundRobin` string
- `duration` integer
- `interval` integer
- `timezoneName` string
- `tzOffset` integer
- `destination` string
- `dayAvailabilityStartDate` string, date-time
- `dayAvailability` integer
- `firstDayAvailable` boolean

## Response `200`

Success

- AvailabilityViewModel
  - `url` string, nullable
  - `object` string, nullable
  - `businessName` string, nullable
  - `locationId` string, nullable
  - `serviceId` string, nullable
  - `serviceName` string, nullable
  - `serviceDescription` string, nullable
  - `serviceDuration` integer
  - `startDate` string, nullable
  - `endDate` string, nullable
  - `resourceId` string, nullable
  - `resourceIds` string, nullable
  - `resourceName` string, nullable
  - `resourceDescription` string, nullable
  - `calendarId` string, nullable
  - `calendarResourceGroupId` string, nullable
  - `timezoneName` string, nullable — Returns the Timezone Name in IANA format if a TimezoneName was passed into an Availability call; otherwise this property is hidden
  - `tzRequested` integer, nullable — Returns the timezone offset if a tzOffset was supplied into an Availability call; null if a TimezoneName was passed; otherwise the Business timezone offset is returned
  - `firstAvailableDate` string, nullable
  - `availableDays` AvailableDayViewModel[], nullable
    - `object` string, nullable
    - `date` string, nullable
    - `closed` boolean
    - `available` boolean
    - `reasonCode` integer
    - `reason` string, nullable
    - `bookingLimit` integer
    - `bookingCount` integer
  - `availableTimes` AvailableTimeViewModel[], nullable
    - `startDateTime` string, nullable
    - `endDateTime` string, nullable
    - `date` string, nullable
    - `time` integer
    - `displayTime` string, nullable
    - `duration` integer
    - `allowableBookings` integer
    - `availableBookings` integer
    - `allowableCapacity` integer
    - `availableCapacity` integer
    - `resourceId` string, nullable
    - `travelTimeMins` integer
    - `travelAppointmentId` string, nullable

---

[API](https://skmtc.net/onsched/apis/onsched-consumer-api.md) · [All operations](https://skmtc.net/onsched/apis/onsched-consumer-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/onsched/onsched-consumer-api/versions/1cd2a28a0305/schema)
