Skip to main content

Available Appointment Times

Returns available appointment times for the employee group identified by group_id. from_date is required. to_date is optional; when omitted, availability is returned for from_date only. The range between from_date and to_date may not exceed 60 days.

GET
/api/v2/appointments/group/:group_id/available-times

Request

Example request payloadGET
curl -X GET \
    --user "YOUR_API_KEY:" \
    "https://api.funnelleasing.com/api/v2/appointments/group/123/available-times"

Response

Example responseJSON200 · application/json
{
  "available_times": [
    "2019-06-19T08:00:00",
    "2019-06-19T08:15:00",
    "2019-06-19T08:30:00",
    "2019-06-19T08:45:00",
    "2019-06-19T17:45:00",
    "2019-06-19T18:00:00",
    "2019-06-19T18:15:00",
    "2019-06-19T18:30:00",
    "2019-06-19T18:45:00",
    "2019-06-19T19:00:00",
    "2019-06-19T19:15:00",
    "2019-06-19T19:30:00"
  ],
  "interval": 15,
  "duration": 30,
  "timezone": "America/New_York",
  "next_available_date": null
}
ℹ️

spans=true response shape

For example, with a 15-minute interval, times of 08:00, 08:15, 08:30, and 08:45 collapse into a single { "from": "…T08:00:00", "to": "…T08:45:00" } span (see the available_times description above for what from/to mean exactly):

Example response when spans=true is passed
Example response (spans=true)
{
  "available_times": [
    { "from": "2019-06-19T08:00:00", "to": "2019-06-19T08:45:00" },
    { "from": "2019-06-19T17:45:00", "to": "2019-06-19T19:30:00" }
  ],
  "interval": 15,
  "duration": 30,
  "timezone": "America/New_York",
  "next_available_date": null
}

Errors common to all appointment endpoints

The two errors below can be returned by any Customer API endpoint that operates on a specific employee group (group_id) — this endpoint, Appointment Times (Deprecated), Book an Appointment, and Reschedule an Appointment. They are checked before any endpoint-specific validation runs. Note the unusual response shape: these use status and message fields, not the error_type/errors shape used elsewhere in the Customer API.

Employee Group Not Found (404)

Returned when group_id doesn't exist or belongs to a different company than the one that owns the API key. Group lookup is always scoped to the company that owns the API key.

Error responseJSON404 · application/json
{
  "status": 404,
  "message": "Employee Group not found"
}

Employee Group Not Active (400)

Returned when the group exists but has tour scheduling disabled.

Error responseJSON400 · application/json
{
  "status": 400,
  "message": "Employee Group is not active"
}

Errors specific to this endpoint

Tour Type Not Enabled (400)

If the provided tour type is not enabled, a 400 error response will be returned.

Error responseJSON400 · application/json
{
  "error_type": "NotAvailable",
  "errors": {
    "tour_type": ["Tours are disabled."]
  }
}

Invalid Tour Type (400)

If the provided tour type is invalid, a 400 error response will be returned.

Error responseJSON400 · application/json
{
  "error_type": "ValidationError",
  "errors": {
    "tour_type": [
      "Select a valid choice. onlineTour is not one of the available choices."
    ]
  }
}

Date Range Exceeds 60 Days (400)

If the range between from_date and to_date exceeds 60 days, a 400 error response will be returned.

Error responseJSON400 · application/json
{
  "error_type": "ValidationError",
  "errors": {
    "to_date": ["Date range can not exceed 60 days."]
  }
}

Cannot Book This Far Ahead (400)

If from_date is further ahead than the company's maximum booking window, a 400 error response will be returned. Note the error is keyed on to_date even though the offending value is from_date.

Error responseJSON400 · application/json
{
  "error_type": "NotAvailable",
  "errors": {
    "to_date": ["Cannot book this far ahead."]
  }
}

Invalid Date Range (400)

If the provided to_date is before the from_date, a 400 error response will be returned.

Error responseJSON400 · application/json
{
  "error_type": "ValidationError",
  "errors": {
    "to_date": ["to_date must be after from_date"]
  }
}

Missing Required Field (400)

If a required field such as from_date is missing in the request, a 400 error response will be returned.

Error responseJSON400 · application/json
{
  "error_type": "ValidationError",
  "errors": {
    "from_date": ["This field is required."]
  }
}

Invalid Data Type (400)

If the provided data type is not valid, a 400 error response will be returned.

Error responseJSON400 · application/json
{
  "error_type": "ValidationError",
  "errors": {
    "to_date": ["Enter a valid date."]
  }
}