Skip to content
Hydda One API
Esc
↑↓navigate↵open⌘Jpreview

Read a resource's free time

Returns the free time over a run of local dates, at most 31 days, shaped by the resource’s booking model. Use it to draw a calendar or a slot picker. The answer is a guide: a request checks every rule again and can still be refused, most often on a resource with several units.

GET/v1/booking/resources/{resourceId}/availability
Authorization
AuthorizationOAuth2 access token · headerrequired

An access token for an Application, from the client_credentials grant. An integration of your own uses the same grant. A connector from Hydda gets its token from the installation-token grant instead. Send it as Authorization: Bearer <token>.

Path parameters
resourceIdstring<uuid>required

The resource id, as the resource list returns it.

Query parameters
fromDatestring<date>required

The first date to read, as YYYY-MM-DD in the resource's time zone.

toDatestring<date>required

The last date to read, included, as YYYY-MM-DD in the resource's time zone. The run covers at most 31 days.

Responses
200

The free time over the dates asked for.

One of:
object
modelstringrequired

The resource is booked by a start and an end time.

Allowed:time_interval
windowsobject[]required

The free time a request can fit inside. A request starts on the increment grid and lasts within the duration bounds.

Show properties
Array of object
startsAtstring<date-time>required

When the free time starts, as an ISO 8601 timestamp in UTC.

endsAtstring<date-time>required

When the free time ends, as an ISO 8601 timestamp in UTC.

object
modelstringrequired

The resource is booked one slot at a time.

Allowed:time_slots
slotsobject[]required

Every slot nobody holds.

Show properties
Array of object
startsAtstring<date-time>required

When the free time starts, as an ISO 8601 timestamp in UTC.

endsAtstring<date-time>required

When the free time ends, as an ISO 8601 timestamp in UTC.

timeSpecobjectrequired

The time a booking is for. Its model must match the resource's bookingRules.model, and each model sends a different shape.

Show properties
One of:
object
modelstringrequired

For a resource booked by a start and an end time.

Allowed:time_interval
startsAtstring<date-time>required

When the booking starts, as an ISO 8601 timestamp in UTC.

endsAtstring<date-time>required

When the booking ends, as an ISO 8601 timestamp in UTC.

object
modelstringrequired

For a resource booked as a stay between two dates.

Allowed:date_interval
fromDatestring<date>required

The arrival date, as YYYY-MM-DD in the resource's time zone.

toDatestring<date>required

The departure date, as YYYY-MM-DD in the resource's time zone. After fromDate.

object
modelstringrequired

For a resource booked one slot at a time.

Allowed:time_slots
datestring<date>required

The date of the slot, as YYYY-MM-DD in the resource's time zone.

startMinuteOfDayintegerrequired

The slot's start, in minutes after local midnight, as the schedule lists it.

min 0 · max 1439
object
modelstringrequired

For a resource booked by the date a fixed window starts on.

Allowed:date_span
datestring<date>required

The date the window starts on, as YYYY-MM-DD in the resource's time zone.

object
modelstringrequired

The resource is booked as a stay between two dates.

Allowed:date_interval
freeNightsstring<date>[]required

Each local date whose night nobody holds. A stay is any run of free nights within the minimum and maximum nights.

object
modelstringrequired

The resource is booked by the date a fixed window starts on.

Allowed:date_span
daysobject[]required

Every date whose window has a unit left.

Show properties
Array of object
startsAtstring<date-time>required

When the free time starts, as an ISO 8601 timestamp in UTC.

endsAtstring<date-time>required

When the free time ends, as an ISO 8601 timestamp in UTC.

datestring<date>required

The local date the window starts on, as YYYY-MM-DD.

remainingintegerrequired

How many units are still free for this window.

max 9007199254740991
timeSpecobjectrequired

The time a booking is for. Its model must match the resource's bookingRules.model, and each model sends a different shape.

Show properties
One of:
object
modelstringrequired

For a resource booked by a start and an end time.

Allowed:time_interval
startsAtstring<date-time>required

When the booking starts, as an ISO 8601 timestamp in UTC.

endsAtstring<date-time>required

When the booking ends, as an ISO 8601 timestamp in UTC.

object
modelstringrequired

For a resource booked as a stay between two dates.

Allowed:date_interval
fromDatestring<date>required

The arrival date, as YYYY-MM-DD in the resource's time zone.

toDatestring<date>required

The departure date, as YYYY-MM-DD in the resource's time zone. After fromDate.

object
modelstringrequired

For a resource booked one slot at a time.

Allowed:time_slots
datestring<date>required

The date of the slot, as YYYY-MM-DD in the resource's time zone.

startMinuteOfDayintegerrequired

The slot's start, in minutes after local midnight, as the schedule lists it.

min 0 · max 1439
object
modelstringrequired

For a resource booked by the date a fixed window starts on.

Allowed:date_span
datestring<date>required

The date the window starts on, as YYYY-MM-DD in the resource's time zone.

400

The request is not valid, or a business rule refused it. code names the rule.

typestringrequired

Always about:blank.

titlestringrequired

The HTTP status phrase, for example Not Found.

statusintegerrequired

The HTTP status code.

min -9007199254740991 · max 9007199254740991
detailstring

What went wrong, for a person to read. Do not parse it.

codestring

Names the rule that refused the request, when the failure has one. Match on this, not on detail.

Allowed:VALIDATION_FAILED
parametersobject

Values the refusal names, keyed by what they are, for example occurrenceDate with BOOKING_SERIES_CONFLICT.

issuesobject[]

With VALIDATION_FAILED: one entry per field that failed validation, each with its path and message.

401

The access token is missing, expired or not valid.

typestringrequired

Always about:blank.

titlestringrequired

The HTTP status phrase, for example Not Found.

statusintegerrequired

The HTTP status code.

min -9007199254740991 · max 9007199254740991
detailstring

What went wrong, for a person to read. Do not parse it.

codestring

Names the rule that refused the request. Match on this, not on detail.

parametersobject

Values the refusal names, keyed by what they are, for example occurrenceDate with BOOKING_SERIES_CONFLICT.

issuesobject[]

With VALIDATION_FAILED: one entry per field that failed validation, each with its path and message.

403

The token does not allow this request.

typestringrequired

Always about:blank.

titlestringrequired

The HTTP status phrase, for example Not Found.

statusintegerrequired

The HTTP status code.

min -9007199254740991 · max 9007199254740991
detailstring

What went wrong, for a person to read. Do not parse it.

codestring

Names the rule that refused the request. Match on this, not on detail.

parametersobject

Values the refusal names, keyed by what they are, for example occurrenceDate with BOOKING_SERIES_CONFLICT.

issuesobject[]

With VALIDATION_FAILED: one entry per field that failed validation, each with its path and message.

404

The resource does not exist, or the token cannot see it.

typestringrequired

Always about:blank.

titlestringrequired

The HTTP status phrase, for example Not Found.

statusintegerrequired

The HTTP status code.

min -9007199254740991 · max 9007199254740991
detailstring

What went wrong, for a person to read. Do not parse it.

codestring

Names the rule that refused the request. Match on this, not on detail.

parametersobject

Values the refusal names, keyed by what they are, for example occurrenceDate with BOOKING_SERIES_CONFLICT.

issuesobject[]

With VALIDATION_FAILED: one entry per field that failed validation, each with its path and message.

Request
curl -X GET 'https://api.hydda.one/v1/booking/resources/497f6eca-6276-4993-bfeb-53cbbbba6f08/availability?fromDate=2019-08-24&toDate=2019-08-24' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'Accept: application/json'
Response
{
  "model": "time_interval",
  "windows": [
    {
      "startsAt": "2019-08-24T14:15:22Z",
      "endsAt": "2019-08-24T14:15:22Z"
    }
  ]
}