Get free slots for a calendar between a date range. Optionally a consumer can also request free slots in a particular timezone and also for a particular user.
http
GET https://services.leadconnectorhq.com/calendars/{calendarId}/free-slotsAuthorization
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
Authorization | string | Yes | Bearer token generated from the Leadway portal. See Authentication. | |
Version | string | Yes | 2021-07-28 | API version. |
Path parameters
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
calendarId | string | Yes | ocQHyuzHvysMo5N5VsXc | Calendar Id |
Query parameters
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
startDate | number | Yes | 1548898600000 | Start Date (⚠️ Important: Date range cannot be more than 31 days) |
endDate | number | Yes | 1601490599999 | End Date (⚠️ Important: Date range cannot be more than 31 days) |
timezone | string | No | America/Chihuahua | The timezone in which the free slots are returned |
userId | string | No | 082goXVW3lIExEQPOnd3 | The user for whom the free slots are returned |
userIds | string[] | No | The users for whom the free slots are returned |
Responses
200 - Availability map keyed by date (YYYY-MM-DD)
json
{
"2024-10-28": {
"slots": [
"2024-10-28T10:00:00-05:00",
"2024-10-28T11:00:00-05:00"
]
},
"2024-10-29": {
"slots": [
"2024-10-29T10:00:00-05:00",
"2024-10-29T14:30:00-05:00"
]
}
}400 - Bad Request
json
{}Example
curl -X GET 'https://services.leadconnectorhq.com/calendars/YOUR_calendarId/free-slots' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28'const response = await fetch('https://services.leadconnectorhq.com/calendars/YOUR_calendarId/free-slots', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
Version: '2021-07-28',
},
});
const data = await response.json();import os, requests
response = requests.request(
'GET',
'https://services.leadconnectorhq.com/calendars/YOUR_calendarId/free-slots',
headers={
'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
'Version': '2021-07-28',
},
)
data = response.json()<?php
$ch = curl_init('https://services.leadconnectorhq.com/calendars/YOUR_calendarId/free-slots');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
'Version: 2021-07-28',
],
]);
$data = json_decode(curl_exec($ch), true);