Create appointment
POST https://services.leadconnectorhq.com/calendars/events/appointmentsAuthorization
| 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 |
meetingLocationType | string | No | custom | Meeting account type. - If address is provided in the request body, the meetingLocationType defaults to custom. Possible values: 'custom', 'zoom', 'gmeet', 'phone', 'address', 'ms_teams', 'google' |
meetingLocationId | string | No | custom_0 | The unique identifier for the meeting account. - This value can be found in calendar.locationConfigurationsor calendar.teamMembers[].locationConfigurations |
overrideLocationConfig | boolean | No | True | Flag to override account config - false - If only meetingLocationId is provided - true - If only meetingLocationType is provided |
appointmentStatus | string | No | confirmed | Possible values: 'new', 'confirmed', 'cancelled', 'showed', 'noshow', 'invalid' |
assignedUserId | string | No | 0007BWpSzSwfiuSl0tR2 | Assigned User Id |
description | string | No | Booking a call to discuss the project | Appointment Description |
address | string | No | Zoom | Appointment Address |
ignoreDateRange | boolean | No | False | If set to true, the minimum scheduling notice and date range would be ignored |
toNotify | boolean | No | False | If set to false, the automations will not run |
ignoreFreeSlotValidation | boolean | No | True | If true the time slot validation would be avoided for any appointment creation (even the ignoreDateRange) |
rrule | string | No | RRULE as per the iCalendar (RFC 5545) specification for recurring events. DTSTART is not required, instance ids are calculated on the basis of startTime of the event. The rrule only be applied if ignoreFreeSlotValidation is true. | |
calendarId | string | Yes | CVokAlI8fgw4WYWoCtQz | Calendar Id |
locationId | string | Yes | C2QujeCh8ZnC7al2InWR | Account Id |
contactId | string | Yes | 0007BWpSzSwfiuSl0tR2 | Contact Id |
startTime | string | Yes | 2021-06-23T03:30:00+05:30 | Start Time |
endTime | string | No | 2021-06-23T04:30:00+05:30 | End Time |
Responses
200 - Successful response
calendarId(string, required): Calendar Id Example:CVokAlI8fgw4WYWoCtQzlocationId(string, required): Account Id Example:C2QujeCh8ZnC7al2InWRcontactId(string, required): Contact Id Example:0007BWpSzSwfiuSl0tR2startTime(string): Start Time Example:2021-06-23T03:30:00+05:30endTime(string): End Time Example:2021-06-23T04:30:00+05:30title(string): Title Example:Test EventmeetingLocationType(string): Meeting Account Type Example:customappointmentStatus(string): Possible values: 'new', 'confirmed', 'cancelled', 'showed', 'noshow', 'invalid', 'active', 'completed' Example:confirmedassignedUserId(string): Assigned User Id Example:0007BWpSzSwfiuSl0tR2address(string): Appointment Address Example:ZoomisRecurring(boolean): true if the event is recurring otherwise false Example:truerrule(string): RRULE as per the iCalendar (RFC 5545) specification for recurring eventsid(string, required): Id Example:0TkCdp9PfvLeWKYRRvIz
{
"calendarId": "CVokAlI8fgw4WYWoCtQz",
"locationId": "C2QujeCh8ZnC7al2InWR",
"contactId": "0007BWpSzSwfiuSl0tR2",
"startTime": "2021-06-23T03:30:00+05:30",
"endTime": "2021-06-23T04:30:00+05:30",
"title": "Test Event",
"meetingLocationType": "custom",
"appointmentStatus": "confirmed",
"assignedUserId": "0007BWpSzSwfiuSl0tR2",
"address": "Zoom",
"isRecurring": "true",
"rrule": "string",
"id": "0TkCdp9PfvLeWKYRRvIz"
}400 - Bad Request
{}Example
curl -X POST 'https://services.leadconnectorhq.com/calendars/events/appointments' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28' \
-H 'Content-Type: application/json' \
-d '{
"title": "Test Event",
"meetingLocationType": "custom",
"meetingLocationId": "custom_0",
"overrideLocationConfig": true,
"appointmentStatus": "confirmed",
"assignedUserId": "0007BWpSzSwfiuSl0tR2",
"description": "Booking a call to discuss the project",
"address": "Zoom",
"ignoreDateRange": false,
"toNotify": false,
"ignoreFreeSlotValidation": true,
"rrule": "string",
"calendarId": "CVokAlI8fgw4WYWoCtQz",
"locationId": "C2QujeCh8ZnC7al2InWR",
"contactId": "0007BWpSzSwfiuSl0tR2",
"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/appointments', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
Version: '2021-07-28',
'Content-Type': 'application/json',
},
body: JSON.stringify({"title": "Test Event", "meetingLocationType": "custom", "meetingLocationId": "custom_0", "overrideLocationConfig": true, "appointmentStatus": "confirmed", "assignedUserId": "0007BWpSzSwfiuSl0tR2", "description": "Booking a call to discuss the project", "address": "Zoom", "ignoreDateRange": false, "toNotify": false, "ignoreFreeSlotValidation": true, "rrule": "string", "calendarId": "CVokAlI8fgw4WYWoCtQz", "locationId": "C2QujeCh8ZnC7al2InWR", "contactId": "0007BWpSzSwfiuSl0tR2", "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/appointments',
headers={
'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
'Version': '2021-07-28',
'Content-Type': 'application/json',
},
json={"title": "Test Event", "meetingLocationType": "custom", "meetingLocationId": "custom_0", "overrideLocationConfig": true, "appointmentStatus": "confirmed", "assignedUserId": "0007BWpSzSwfiuSl0tR2", "description": "Booking a call to discuss the project", "address": "Zoom", "ignoreDateRange": false, "toNotify": false, "ignoreFreeSlotValidation": true, "rrule": "string", "calendarId": "CVokAlI8fgw4WYWoCtQz", "locationId": "C2QujeCh8ZnC7al2InWR", "contactId": "0007BWpSzSwfiuSl0tR2", "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/appointments');
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', 'meetingLocationType': 'custom', 'meetingLocationId': 'custom_0', 'overrideLocationConfig': true, 'appointmentStatus': 'confirmed', 'assignedUserId': '0007BWpSzSwfiuSl0tR2', 'description': 'Booking a call to discuss the project', 'address': 'Zoom', 'ignoreDateRange': false, 'toNotify': false, 'ignoreFreeSlotValidation': true, 'rrule': 'string', 'calendarId': 'CVokAlI8fgw4WYWoCtQz', 'locationId': 'C2QujeCh8ZnC7al2InWR', 'contactId': '0007BWpSzSwfiuSl0tR2', 'startTime': '2021-06-23T03:30:00+05:30', 'endTime': '2021-06-23T04:30:00+05:30'}),
]);
$data = json_decode(curl_exec($ch), true);