gohighlevel-php-sdk

Calendars Resource

Calendar

The Calendar class provides methods to manage calendars, their availability slots, and to access related calendar groups, events, and resources. It interacts with several GoHighLevel API endpoints to handle calendar-specific functionality.


slots(string $calendarId, string $startDate, string $endDate, array $params = []): array|string

This method retrieves the available free time slots for a specific calendar within a given date range.


update(string $calendarId, array $params = []): array|string

Updates the properties of an existing calendar.


get(string $calendarId): array|string

Retrieves a specific calendar by its ID.


delete(string $calendarId): array|string

Deletes a calendar.


list(string $locationId, array $params = []): array|string

Retrieves a list of all calendars in a given location.


create(string $locationId, string $name, array $params = []): array|string

Creates a new calendar within a specified location.


groups(): GroupContract

This method returns an instance of the Group resource, which provides access to methods for managing calendar groups.


events(): EventContract

This method returns an instance of the Event resource, which provides access to methods for managing calendar events and appointments.


resources(): CalendarResourceContract

This method returns an instance of the CalendarResource resource, which provides access to methods for managing calendar resources (e.g., users, rooms).


CalendarResource

The CalendarResource class provides methods to manage resources associated with calendars, such as users or equipment. The resourceType parameter is used to specify the type of resource being managed.


get(string $id, string $resourceType): array|string

Retrieves a specific calendar resource by its ID and type.


update(string $id, string $resourceType, array $params = []): array|string

Updates a specific calendar resource.


delete(string $id, string $resourceType): array|string

Deletes a specific calendar resource.


list(string $resourceType, $params = []): array|string

Retrieves a list of all resources of a specific type.


create(string $resourceType, $params = []): array|string

Creates a new calendar resource of a specific type.


Event

The Event class provides methods to manage calendar events, appointments, and blocked slots.


list(string $locationId, array $params = []): array|string

Retrieves a list of events in a specified location.


get(string $locationId, string $startTime, string $endTime, array $params = []): array|string

Retrieves a list of events in a specified location within a given time range.


slots(string $locationId, string $endTime, string $startTime, array $params = []): array|string

Retrieves a list of blocked slots within a specific time range for a location.


getAppointment(string $eventId): array|string

Retrieves a specific appointment event by its ID.


editAppointment(string $eventId, array $params = []): array|string

Updates an existing appointment event.


createAppointment(string $calendarId, string $locationId, string $contactId, string $startTime, array $params): array|string

Creates a new appointment.


createSlot(string $locationId, string $startTime, string $endTime, array $params = []): array|string

Creates a new blocked slot on a calendar.


editSlot(string $eventId, array $params = []): array|string

Updates an existing blocked slot.


delete(string $eventId): array|string

Deletes a calendar event or blocked slot.


Group

The Group class provides methods to manage calendar groups, which are collections of calendars.


get(string $locationId): array|string

Retrieves a list of all calendar groups in a location.


create(array $params): array|string

Creates a new calendar group.


validate(string $locationId, string $slug, bool $available): array|string

Validates if a calendar group slug is available.


delete(string $groupId): array|string

Deletes a calendar group.


update(string $groupId, array $params = []): array|string

Updates an existing calendar group.


disable(string $groupId, bool $isActive): array|string

Disables or enables a calendar group.