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

onsched.com:consumer

Summary: Get Available Times
Operation ID:
Auth: unknown
Description

<p> <b>Choose your search criteria carefully. Availability is an expensive call.</b> 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.</p> <p>A <b>serviceId</b> is required. The <b>startDate</b> and <b>endDate</b> are required and are formatted as: <b>YYYY-MM-DD</b></p> <p>A <b>resourceId</b> is optional, it is recommended if known at the time of availability call.</p> <p> <b>timezoneName</b> is optional, it allows you to specify the IANA formatted name for the end user's timezone to view availability. e.g., <i>America/New_York</i>. <b>NOTE: This is the recommended approach for your implementation.</b> 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. </p> <p> <b>duration</b> should only be populated if you allow the end user to select a duration, otherwise the service's duration will be used.</p> <p> <b>startTime</b> and <b>endTime</b> are optional and are specified in <b>military time e.g., 800 = 8:00am, 2230 = 10:30pm</b>. Note: You will only see availability within the boundary of your business location start and end times.</p> <p> <b>dayAvailability</b> will return day level availability for the number of days requested from the start date. See <i>GET /consumer/v1/availability/{serviceId}/{startDate}/{endDate}/days</i> for details.</p> <p> <b>firstDayAvailable</b> 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.</p> <p> <b>tzOffset</b> 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.</p> <p>Availability can be complex. For further troubleshooting refer to the: <i><b>GET /consumer/v1/availability/{serviceId}/{startDate}/{endDate}/unavailable</b></i> 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: <a href="https://onsched.readme.io/docs/availability-overview">Availability Overview</a></p>

Parameters (18)

dayAvailability (integer, query, optional)

Number of days of day availability to return

dayAvailabilityStartDate (string, query, optional)

Format YYYY-DD-YY: Start date for day availability, defaults to startDate

destination (string, query, optional)

For calculating travel based availability, requires distance scope

duration (integer, query, optional)

Duration of the service if different from default

endDate (string, path, required)

Format YYYY-MM-DD: End Date for availability search

endTime (integer, query, optional)

Format Military Time. End Time for availability search. Defaults to Business Hours End

firstDayAvailable (boolean, query, optional)

Return available times for the first available day

interval (integer, query, optional)

Booking Interval if different than the default

locationId (string, query, optional)

Id of business location, defaults to primary business location

resourceGroupId (string, query, optional)

Resource Group Id for availability search

resourceId (string, query, optional)

Resource Id for availability search

resourceIds (string, query, optional)

Comma separated Resource Id's for availability search

roundRobin (string, query, optional)

Round robin choice 0=none, 1=random, 2=balanced

serviceId (string, path, required)

Service Id for availability search

startDate (string, path, required)

Format YYYY-MM-DD: Start Date for availability search

startTime (integer, query, optional)

Format Military Time Start Time for availability search. Defaults to Business Hours Start

timezoneName (string, query, optional)

Requested IANA timezone Id to view availability

tzOffset (integer, query, optional)

Request timezone offset to view availability

No probe data for this endpoint yet.