Introduction
With the Schedule API you can share the lineup of an event’s activities, presentations, performances, or sessions. Guests can make a personalized agenda with their chosen items by bookmarking them. The created schedule will appear on your Event Details page.
With the Schedule API you can:
- Add, delete, update schedule items.
- Adjust time of all draft schedule items at once.
- Publish or discard draft schedule.
- Get the information about schedules.
Terminology
- Schedule: A structured plan or timetable that outlines the sequence of activities, presentations, performances, or sessions scheduled to occur during an event.
- Schedule item: A specific activity, presentation, performance, or session listed within the overall schedule of an event. Each schedule item represents a distinct component of the event's agenda and may include details such as the activity name, time slot, location, and any additional information relevant to the event's program.
- Event: A gathering organized by an individual or business for a group of people.
Setup
To use the Schedule API, install the @wix/events
package using npm or Yarn:
1npm install @wix/events
or
1yarn add @wix/events
Then import { schedule }
from @wix/events
:
1import { schedule } from '@wix/events'
Adds a schedule item to the draft schedule.
function addScheduleItem(eventId: string, options: AddScheduleItemOptions): Promise<AddScheduleItemResponse>
Event ID to which the schedule belongs.
Optional fields.
Deletes schedule items from the draft schedule.
function deleteScheduleItem(eventId: string, options: DeleteScheduleItemOptions): Promise<void>
Event ID to which the schedule belongs.
Optional fields.
Clears all changes to the draft schedule.
function discardDraft(eventId: string): Promise<void>
Event ID to which the schedule belongs.
Retrieves schedule item by ID.
function getScheduleItem(itemId: string, options: GetScheduleItemOptions): Promise<ScheduleItem>
Schedule item ID.
Optional fields.
Retrieves a list of up to 100 schedule items
function listScheduleItems(options: ListScheduleItemsOptions): Promise<ListScheduleItemsResponse>
Optional fields.
Publishes the draft schedule.
function publishDraft(eventId: string): Promise<void>
Event ID to which the schedule belongs.
Creates a query to retrieve a list of schedule items.
The queryScheduleItems( )
function builds a query to retrieve a list of schedule items and returns a ItemsQueryBuilder
object.
The returned object contains the query definition, which is typically used to run the query using the find()
function.
You can refine the query by chaining ItemsQueryBuilder
functions onto the query. ItemsQueryBuilder
functions enable you to sort, filter, and control the results queryScheduleItems( )
returns.
queryScheduleItems( )
runs with these ItemsQueryBuilder
defaults, which you can override:
The functions that are chained to queryScheduleItems( )
are applied in the order they're called. For example, if you apply ascending('name')
and then descending('stageName')
, the results are sorted first by the name
, and then, if there are multiple results with the same name
, the items are sorted by stageName
.
PROPERTY | SUPPORTED FILTERS & SORTING |
---|---|
_id | eq() ,ne() ,ascending() ,descending() |
name | eq() ,ne() ,ascending() ,descending() |
description | eq() ,ne() ,ascending() ,descending() |
stageName | eq() ,ne() ,ascending() ,descending() |
_createdDate | eq() ,ne() ,lt() ,le() ,gt() ,ge() ,ascending() ,descending() |
_updatedDate | eq() ,ne() ,lt() ,le() ,gt() ,ge() ,ascending() ,descending() |
eventId | eq() ,ne() ,ascending() ,descending() |
function queryScheduleItems(): ItemsQueryBuilder
Adjusts the time of all draft schedule items at once per event.
function rescheduleDraft(eventId: string, options: RescheduleDraftOptions): Promise<void>
Event ID to which the schedule belongs.
Optional fields.
Updates a schedule item in a draft schedule.
function updateScheduleItem(itemId: string, eventId: string, options: UpdateScheduleItemOptions): Promise<UpdateScheduleItemResponse>
Schedule item ID.
Event ID to which the schedule belongs.
Optional fields.