Create block slot
http
POST https://services.leadconnectorhq.com/calendars/events/block-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. |
Body
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
title | string | No | Test Event | Title |
calendarId | string | Yes | CVokAlI8fgw4WYWoCtQz | Either calendarId or assignedUserId can be set, not both. |
assignedUserId | string | No | CVokAlI8fgw4WYWoCtQz | Either calendarId or assignedUserId can be set, not both. |
locationId | string | Yes | C2QujeCh8ZnC7al2InWR | Account Id |
startTime | string | No | 2021-06-23T03:30:00+05:30 | Start Time |
endTime | string | No | 2021-06-23T04:30:00+05:30 | End Time |
Responses
201 - Successful response
id(string, required): Id Example:0TkCdp9PfvLeWKYRRvIzlocationId(string, required): Account Id Example:C2QujeCh8ZnC7al2InWRtitle(string, required): Title Example:My eventstartTime(object, required): Start Time Example:2021-06-23T03:30:00+05:30endTime(object, required): End Time Example:2021-06-23T04:30:00+05:30calendarId(string): Calendar id Example:CVokAlI8fgw4WYWoCtQzassignedUserId(string): Assigned User Id Example:0007BWpSzSwfiuSl0tR2
json
{
"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"
}400 - Bad Request
json
{}Example
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);