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.
GET https://services.leadconnectorhq.com/calendars/{calendarId}/free-slots
Autorización
Bearer token generado desde el portal Leadway. Ver Autenticación .
Version
string
default: "2021-07-28"
required
Versión de la API.
Path parameters
calendarId
string
default: "ocQHyuzHvysMo5N5VsXc"
required
Calendar Id
Query parameters
startDate
number
default: "1548898600000"
required
Start Date (⚠️ Important: Date range cannot be more than 31 days)
endDate
number
default: "1601490599999"
required
End Date (⚠️ Important: Date range cannot be more than 31 days)
timezone
string
default: "America/Chihuahua"
The timezone in which the free slots are returned
userId
string
default: "082goXVW3lIExEQPOnd3"
The user for whom the free slots are returned
The users for whom the free slots are returned
Respuestas
200 - Availability map keyed by date (YYYY-MM-DD)
{
"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"
]
}
}
Ejemplo
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 );