Create block slot
POST https://services.leadconnectorhq.com/calendars/events/block-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.
Body
title
string
default:"Test Event"
Title
calendarId
string
default:"CVokAlI8fgw4WYWoCtQz"
required
Either calendarId or assignedUserId can be set, not both.
assignedUserId
string
default:"CVokAlI8fgw4WYWoCtQz"
Either calendarId or assignedUserId can be set, not both.
locationId
string
default:"C2QujeCh8ZnC7al2InWR"
required
Account Id
startTime
string
default:"2021-06-23T03:30:00+05:30"
Start Time
endTime
string
default:"2021-06-23T04:30:00+05:30"
End Time
Respuestas
201 - Successful response
id
string
default:"0TkCdp9PfvLeWKYRRvIz"
required
Id
locationId
string
default:"C2QujeCh8ZnC7al2InWR"
required
Account Id
title
string
default:"My event"
required
Title
startTime
object
default:"2021-06-23T03:30:00+05:30"
required
Start Time
endTime
object
default:"2021-06-23T04:30:00+05:30"
required
End Time
calendarId
string
default:"CVokAlI8fgw4WYWoCtQz"
Calendar id
assignedUserId
string
default:"0007BWpSzSwfiuSl0tR2"
Assigned User Id
{
"id": "0TkCdp9PfvLeWKYRRvIz",
"locationId": "C2QujeCh8ZnC7al2InWR",
"title": "My event",
"startTime": "2021-06-23T03:30:00+05:30",
"endTime": "2021-06-23T04:30:00+05:30",
"calendarId": "CVokAlI8fgw4WYWoCtQz",
"assignedUserId": "0007BWpSzSwfiuSl0tR2"
}
Ejemplo
curl -X POST 'https://services.leadconnectorhq.com/calendars/events/block-slots' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28' \
-H 'Content-Type: application/json' \
-d '{
"title": "Test Event",
"calendarId": "CVokAlI8fgw4WYWoCtQz",
"assignedUserId": "CVokAlI8fgw4WYWoCtQz",
"locationId": "C2QujeCh8ZnC7al2InWR",
"startTime": "2021-06-23T03:30:00+05:30",
"endTime": "2021-06-23T04:30:00+05:30"
}'
const response = await fetch('https://services.leadconnectorhq.com/calendars/events/block-slots', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
Version: '2021-07-28',
'Content-Type': 'application/json',
},
body: JSON.stringify({"title": "Test Event", "calendarId": "CVokAlI8fgw4WYWoCtQz", "assignedUserId": "CVokAlI8fgw4WYWoCtQz", "locationId": "C2QujeCh8ZnC7al2InWR", "startTime": "2021-06-23T03:30:00+05:30", "endTime": "2021-06-23T04:30:00+05:30"}),
});
const data = await response.json();
import os, requests
response = requests.request(
'POST',
'https://services.leadconnectorhq.com/calendars/events/block-slots',
headers={
'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
'Version': '2021-07-28',
'Content-Type': 'application/json',
},
json={"title": "Test Event", "calendarId": "CVokAlI8fgw4WYWoCtQz", "assignedUserId": "CVokAlI8fgw4WYWoCtQz", "locationId": "C2QujeCh8ZnC7al2InWR", "startTime": "2021-06-23T03:30:00+05:30", "endTime": "2021-06-23T04:30:00+05:30"},
)
data = response.json()
<?php
$ch = curl_init('https://services.leadconnectorhq.com/calendars/events/block-slots');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
'Version: 2021-07-28',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({'title': 'Test Event', 'calendarId': 'CVokAlI8fgw4WYWoCtQz', 'assignedUserId': 'CVokAlI8fgw4WYWoCtQz', 'locationId': 'C2QujeCh8ZnC7al2InWR', 'startTime': '2021-06-23T03:30:00+05:30', 'endTime': '2021-06-23T04:30:00+05:30'}),
]);
$data = json_decode(curl_exec($ch), true);