Search.../

getEvent( )

Retrieves a Wix event by ID.

Description

The getEvent() function returns a Promise that resolves to a Wix event whose ID matches the given ID.

Only those with "Manage Events" permissions can get Wix events.

Note: This function requires elevated permissions to run.

This function is not universal and runs only on the backend.

Syntax

function getEvent(eventId: string): Promise<WixEvent>

getEvent Parameters

NAME
TYPE
DESCRIPTION
eventId
string

Event ID.

Returns

Fulfilled - The Wix event. Rejected - Error message.

Return Type:

Promise<WixEvent>
NAME
TYPE
DESCRIPTION
_id
string

Wix event ID.

location
Location

Wix event location details.

scheduling
Scheduling

Wix event scheduling details.

title
string

Wix event title.

description
string

Wix event description.

about
string

Rich-text (HTML) content for the "About Event" section.

mainImage
string

The location of an image that represents the Wix event. This image is printed on the ticket (PDF format). The image file must be an image file from the Media Manager.

The URL format is: wix:image://v1/<uri>/<filename>#originWidth=<width>&originHeight=<height>[&watermark=<watermark_manifest_string>]

slug
string

URL-friendly version of the Wix event title. Unique across all Wix events in the same site.

language
string

ISO 639-1 language code of the Wix event. Use to translate content on forms, and so on.

_createdDate
Date

Date the Wix event was created.

_updatedDate
Date

Date the Wix event was updated.

status
string

Wix event status. Defaults to "SCHEDULED". One of:

  • "SCHEDULED". The upcoming Wix event is scheduled but has not yet started.
  • "STARTED". The Wix event has started and is in progress.
  • "ENDED". The Wix event has ended.
  • "CANCELED". The Wix event has been canceled.
registration
Registration

Registration details for the Wix event.

calendarLinks
CalendarLinks

"Add to calendar" URLs.

eventUrl
SiteUrl

Event page URL components.

form
Form

Registration form for the site guest to fill out with their contact details, and other information, as relevant.

summary
Summaries

Summaries of Wix event sales.

guestList
GuestListSettings

Guest list settings for the Wix event.

createdBy
string

ID of the creator of the Wix event. If the creator is not logged in when creating the event, the createdBy property is empty.

videoConferencing
OnlineConferencing

Online conferencing details for the Wix event.

assignedContactsLabel
string

The "Filter by:" drop-down option for filtering contacts by this event
in the Dashboard's Contact List page. This read-only property is automatically populated to comprise a "custom" prefix, the title of the event, and other suffixes added for uniqueness. Note that even if the title of an event is updated, the assignedContactsLabel does not change.

Was this helpful?

Get a Wix event

Copy Code
1import { wixEvents } from "wix-events-backend";
2import { elevate } from 'wix-auth';
3
4/* Sample eventId value: 'c241e6e2-c951-440d-8b62-52a6ec382140';
5*/
6
7export async function myGetEventFunction(eventId) {
8 try {
9 const elevatedGetEvent = elevate(wixEvents.getEvent);
10 const getEvent = await elevatedGetEvent(eventId);
11 console.log('Success! Event:', getEvent);
12 return getEvent;
13 } catch (error) {
14 console.error(error);
15 // Handle the error
16 }
17}
18
19/* Promise resolves to:
20{
21 "about": "Join us for Nature's Symphony: A Musical Journey Through Wildlife at the iconic Royal Albert Hall.",
22 "assignedContactsLabel": "custom.natures-symphony-a-musical-journey-through-wildlif",
23 "calendarLinks": {
24 "google": "http://calendar.google.com/calendar/render?action=TEMPLATE&text=Nature%27s+Symphony%3A+A+Musical+Journey+Through+Wildlife&dates=20231129T190000Z%2F20231129T230000Z&location=Kensington+Gore%2C+London+SW7%2C+UK&details=Thank+you+for+registering+to+our+event%21+Your+tickets+are+attached+to+this+email.+Don%27t+forget+to+bring+them.%0A%0AWe%27re+looking+forward+to+seeing+you+there.%0A%0AHere+are+the+details%3A%0A%0ANature%27s+Symphony%3A+A+Musical+Journey+Through+Wildlife%0A29+November+2023%2C+19%3A00%E2%80%9323%3A00%0ARoyal+Albert+Hall%2C+Kensington+Gore%2C+London+SW7%2C+UK",
25 "ics": "https://www.wixevents.com/media/v2/calendar?token=JWS.eyJraWQiOiJpb21iOUJ0eSIsImFsZyI6IkhTMjU2In0.eyJkYXRhIjoie1wiaW5zdGFuY2VJZFwiOlwiMWY2ZGM5MDYtODAzZC00NjUwLTgzZjUtNzJlYTFkODgxMDBiXCIsXCJldmVudElkXCI6e1widmFsdWVcIjpcImMyNDFlNmUyLWM5NTEtNDQwZC04YjYyLTUyYTZlYzM4MjE0MFwifSxcIm9jTGlua1wiOm51bGx9IiwiaWF0IjoxNjk5NDUwMDE2fQ.2wZA5WH2TOR4f8M1QICFOu8oD4gX70jBaCRMCFQRbqI"
26 },
27 "categories": [],
28 "createdBy": "8a8b9b73-4da8-47a5-8268-4396e68a0605",
29 "_createdDate": "2023-07-13T12:52:00.911Z",
30 "description": "Immerse yourself in the enchanting harmony of nature's symphony as it intertwines with the power of music!",
31 "eventUrl": {
32 "baseUrl": "https://mysite.com/events",
33 "path": "/event-details-registration/natures-symphony-a-musical-journey-through-wildlife"
34 },
35 "form": {
36 "inputGroups": [
37 {
38 "_id": "name",
39 "inputs": [
40 {
41 "additionalLabels": [],
42 "label": "First name",
43 "maxLength": 50,
44 "name": "firstName",
45 "options": [],
46 "required": true,
47 "type": "TEXT"
48 },
49 {
50 "additionalLabels": [],
51 "label": "Last name",
52 "maxLength": 50,
53 "name": "lastName",
54 "options": [],
55 "required": true,
56 "type": "TEXT"
57 }
58 ],
59 "orderIndex": 0,
60 "system": true,
61 "type": "NAME"
62 },
63 {
64 "_id": "email",
65 "inputs": [
66 {
67 "additionalLabels": [],
68 "label": "Email",
69 "maxLength": 255,
70 "name": "email",
71 "options": [],
72 "required": true,
73 "type": "TEXT"
74 }
75 ],
76 "orderIndex": 1,
77 "system": true,
78 "type": "INPUT"
79 }
80 ],
81 "messages": {
82 "checkout": {
83 "checkoutLabel": "Continue",
84 "title": "Add your details"
85 },
86 "registrationClosed": {
87 "exploreEventsLabel": "See other events",
88 "message": "Registration is closed"
89 },
90 "rsvp": {
91 "noMessages": {
92 "confirmationTitle": "Sorry You Can't Make It",
93 "shareLabel": "Share",
94 "title": "Add your details"
95 },
96 "rsvpNo": "Not Going",
97 "rsvpYes": "I'm Going",
98 "submitRsvpLabel": "SUBMIT",
99 "waitingMessages": {
100 "addToCalendarLabel": "Add to Calendar",
101 "confirmationMessage": "We'll update you if additional spots become available.",
102 "confirmationTitle": "Thanks! You've been added to the waitlist.",
103 "shareLabel": "Share",
104 "title": "Looks like this event is full. Join the waitlist."
105 },
106 "yesMessages": {
107 "addToCalendarLabel": "Add to Calendar",
108 "confirmationMessage": "An email with all the event info was sent to you.",
109 "confirmationTitle": "Thank you!",
110 "shareLabel": "Share",
111 "title": "Add your details"
112 }
113 }
114 }
115 },
116 "guestList": {
117 "public": true
118 },
119 "_id": "c241e6e2-c951-440d-8b62-52a6ec382140",
120 "language": "en",
121 "location": {
122 "address": {
123 "formatted": "Kensington Gore, London SW7, UK",
124 "location": {
125 "latitude": 51.5009132,
126 "longitude": -0.1766086
127 },
128 "city": "London",
129 "country": "GB",
130 "postalCode": "SW7 2BL",
131 "streetAddress": {
132 "name": "Kensington Gore",
133 "number": "SW7",
134 "apt": ""
135 }
136 },
137 "name": "Royal Albert Hall",
138 "tbd": false,
139 "type": "VENUE"
140 },
141 "registration": {
142 "initialType": "TICKETS",
143 "restrictedTo": "VISITOR",
144 "rsvp": {
145 "responseOptions": "YES_ONLY",
146 "waitlist": false
147 },
148 "status": "OPEN_TICKETS",
149 "tickets": {
150 "currency": "EUR",
151 "formAssignedPerTicket": false,
152 "highestTicketPrice": {
153 "currency": "EUR",
154 "value": "20.00"
155 },
156 "highestTicketPriceFormatted": "€20",
157 "lowestTicketPrice": {
158 "currency": "EUR",
159 "value": "20.00"
160 },
161 "lowestTicketPriceFormatted": "€20",
162 "tax": {}
163 },
164 "type": "TICKETS"
165 },
166 "scheduling": {
167 "endDate": "2023-11-29T23:00:00.137Z",
168 "formatted": "29 November 2023, 19:00–23:00",
169 "hideEndDate": false,
170 "showTimeZone": false,
171 "startDate": "2023-11-29T19:00:00.000Z",
172 "startDateFormatted": "29 November 2023",
173 "startTimeFormatted": "19:00",
174 "tbd": false,
175 "timeZoneId": "Europe/Dublin"
176 },
177 "slug": "natures-symphony-a-musical-journey-through-wildlife",
178 "status": "SCHEDULED",
179 "summary": {
180 "rsvp": {
181 "noCount": 0,
182 "totalRsvps": 0,
183 "waitlistCount": 0,
184 "yesCount": 0
185 },
186 "tickets": {
187 "currencyLocked": false,
188 "revenue": {},
189 "totalOrders": 0,
190 "totalSales": {},
191 "totalTickets": 0
192 }
193 },
194 "title": "Nature's Symphony: A Musical Journey Through Wildlife",
195 "_updatedDate": "2023-11-08T13:22:57.000Z",
196 "videoConferencing": {
197 "session": {
198 "guestLink": "https://www.wixevents.com/oc?join=JWS.eyJraWQiOiJpb21iOUJ0eSIsImFsZyI6IkhTMjU2In0.eyJkYXRhIjoie1wiYWN0aW9uXCI6XCJqb2luXCIsXCJpbnN0YW5jZUlkXCI6XCIxZjZkYzkwNi04MDNkLTQ2NTAtODNmNS03MmVhMWQ4ODEwMGJcIixcImV2ZW50SWRcIjpcImMyNDFlNmUyLWM5NTEtNDQwZC04YjYyLTUyYTZlYzM4MjE0MFwifSIsImlhdCI6MTY5OTQ1MDAxNn0.AfJHpzU54hY8M1oVB0KGe47GUSzOzkWBVpKTTWEXk5Y",
199 "hostLink": "https://www.wixevents.com/oc?start=JWS.eyJraWQiOiJpb21iOUJ0eSIsImFsZyI6IkhTMjU2In0.eyJkYXRhIjoie1wiYWN0aW9uXCI6XCJzdGFydFwiLFwiaW5zdGFuY2VJZFwiOlwiMWY2ZGM5MDYtODAzZC00NjUwLTgzZjUtNzJlYTFkODgxMDBiXCIsXCJldmVudElkXCI6XCJjMjQxZTZlMi1jOTUxLTQ0MGQtOGI2Mi01MmE2ZWMzODIxNDBcIn0iLCJpYXQiOjE2OTk0NTAwMTZ9.VmvnxZHBL6cCyE0ZYRdAa6cCud8aNchTTrLJX0b-Mhs"
200 }
201 }
202}
203*/