Skip to content

Commit eae2711

Browse files
authored
chore: update docs to make sure to inform users to pass in cal-api-version header (calcom#24364)
1 parent fac956b commit eae2711

4 files changed

Lines changed: 102 additions & 29 deletions

File tree

apps/api/v2/src/ee/bookings/2024-08-13/controllers/bookings.controller.ts

Lines changed: 48 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ import {
8787
@DocsTags("Bookings")
8888
@ApiHeader({
8989
name: "cal-api-version",
90-
description: `Must be set to ${VERSION_2024_08_13}`,
90+
description: `Must be set to ${VERSION_2024_08_13}. If not set to this value, the endpoint will default to an older version.`,
9191
example: VERSION_2024_08_13,
9292
required: true,
9393
schema: {
@@ -133,6 +133,8 @@ export class BookingsController_2024_08_13 {
133133
134134
If you are creating a seated booking for an event type with 'show attendees' disabled, then to retrieve attendees in the response either set 'show attendees' to true on event type level or
135135
you have to provide an authentication method of event type owner, host, team admin or owner or org admin or owner.
136+
137+
<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>
136138
`,
137139
})
138140
@ApiBody({
@@ -188,6 +190,8 @@ export class BookingsController_2024_08_13 {
188190
189191
If you are fetching a seated booking for an event type with 'show attendees' disabled, then to retrieve attendees in the response either set 'show attendees' to true on event type level or
190192
you have to provide an authentication method of event type owner, host, team admin or owner or org admin or owner.
193+
194+
<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>
191195
`,
192196
})
193197
async getBooking(
@@ -206,7 +210,10 @@ export class BookingsController_2024_08_13 {
206210
@UseGuards(BookingUidGuard)
207211
@ApiOperation({
208212
summary: "Get all the recordings for the booking",
209-
description: `Fetches all the recordings for the booking \`:bookingUid\``,
213+
description: `Fetches all the recordings for the booking \`:bookingUid\`
214+
215+
<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>
216+
`,
210217
})
211218
async getBookingRecordings(@Param("bookingUid") bookingUid: string): Promise<GetBookingRecordingsOutput> {
212219
const recordings = await this.calVideoService.getRecordings(bookingUid);
@@ -221,7 +228,10 @@ export class BookingsController_2024_08_13 {
221228
@UseGuards(BookingUidGuard)
222229
@ApiOperation({
223230
summary: "Get all the transcripts download links for the booking",
224-
description: `Fetches all the transcripts download links for the booking \`:bookingUid\``,
231+
description: `Fetches all the transcripts download links for the booking \`:bookingUid\`
232+
233+
<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>
234+
`,
225235
})
226236
async getBookingTranscripts(@Param("bookingUid") bookingUid: string): Promise<GetBookingTranscriptsOutput> {
227237
const transcripts = await this.calVideoService.getTranscripts(bookingUid);
@@ -236,7 +246,10 @@ export class BookingsController_2024_08_13 {
236246
@UseGuards(ApiAuthGuard)
237247
@ApiHeader(API_KEY_OR_ACCESS_TOKEN_HEADER)
238248
@Permissions([BOOKING_READ])
239-
@ApiOperation({ summary: "Get all bookings" })
249+
@ApiOperation({
250+
summary: "Get all bookings",
251+
description: `<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>`,
252+
})
240253
async getBookings(
241254
@Query() queryParams: GetBookingsInput_2024_08_13,
242255
@GetUser() user: ApiAuthGuardUser
@@ -263,7 +276,10 @@ export class BookingsController_2024_08_13 {
263276
@ApiHeader(OPTIONAL_API_KEY_OR_ACCESS_TOKEN_HEADER)
264277
@ApiOperation({
265278
summary: "Reschedule a booking",
266-
description: "Reschedule a booking or seated booking",
279+
description: `Reschedule a booking or seated booking
280+
281+
<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>
282+
`,
267283
})
268284
@ApiBody({
269285
schema: {
@@ -315,6 +331,8 @@ export class BookingsController_2024_08_13 {
315331
316332
If you are cancelling a seated booking for an event type with 'show attendees' disabled, then to retrieve attendees in the response either set 'show attendees' to true on event type level or
317333
you have to provide an authentication method of event type owner, host, team admin or owner or org admin or owner.
334+
335+
<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>
318336
`,
319337
})
320338
@ApiBody({
@@ -350,7 +368,10 @@ export class BookingsController_2024_08_13 {
350368
@ApiHeader(API_KEY_OR_ACCESS_TOKEN_HEADER)
351369
@ApiOperation({
352370
summary: "Mark a booking absence",
353-
description: "The provided authorization header refers to the owner of the booking.",
371+
description: `The provided authorization header refers to the owner of the booking.
372+
373+
<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>
374+
`,
354375
})
355376
async markNoShow(
356377
@Param("bookingUid") bookingUid: string,
@@ -372,8 +393,10 @@ export class BookingsController_2024_08_13 {
372393
@ApiHeader(API_KEY_OR_ACCESS_TOKEN_HEADER)
373394
@ApiOperation({
374395
summary: "Reassign a booking to auto-selected host",
375-
description:
376-
"Currently only supports reassigning host for round robin bookings. The provided authorization header refers to the owner of the booking.",
396+
description: `Currently only supports reassigning host for round robin bookings. The provided authorization header refers to the owner of the booking.
397+
398+
<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>
399+
`,
377400
})
378401
async reassignBooking(
379402
@Param("bookingUid") bookingUid: string,
@@ -394,8 +417,10 @@ export class BookingsController_2024_08_13 {
394417
@ApiHeader(API_KEY_OR_ACCESS_TOKEN_HEADER)
395418
@ApiOperation({
396419
summary: "Reassign a booking to a specific host",
397-
description:
398-
"Currently only supports reassigning host for round robin bookings. The provided authorization header refers to the owner of the booking.",
420+
description: `Currently only supports reassigning host for round robin bookings. The provided authorization header refers to the owner of the booking.
421+
422+
<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>
423+
`,
399424
})
400425
async reassignBookingToUser(
401426
@Param("bookingUid") bookingUid: string,
@@ -423,7 +448,10 @@ export class BookingsController_2024_08_13 {
423448
@ApiHeader(API_KEY_OR_ACCESS_TOKEN_HEADER)
424449
@ApiOperation({
425450
summary: "Confirm a booking",
426-
description: "The provided authorization header refers to the owner of the booking.",
451+
description: `The provided authorization header refers to the owner of the booking.
452+
453+
<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>
454+
`,
427455
})
428456
async confirmBooking(
429457
@Param("bookingUid") bookingUid: string,
@@ -444,7 +472,10 @@ export class BookingsController_2024_08_13 {
444472
@ApiHeader(API_KEY_OR_ACCESS_TOKEN_HEADER)
445473
@ApiOperation({
446474
summary: "Decline a booking",
447-
description: "The provided authorization header refers to the owner of the booking.",
475+
description: `The provided authorization header refers to the owner of the booking.
476+
477+
<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>
478+
`,
448479
})
449480
async declineBooking(
450481
@Param("bookingUid") bookingUid: string,
@@ -465,8 +496,10 @@ export class BookingsController_2024_08_13 {
465496
@ApiHeader(API_KEY_OR_ACCESS_TOKEN_HEADER)
466497
@ApiOperation({
467498
summary: "Get 'Add to Calendar' links for a booking",
468-
description:
469-
"Retrieve calendar links for a booking that can be used to add the event to various calendar services. Returns links for Google Calendar, Microsoft Office, Microsoft Outlook, and a downloadable ICS file.",
499+
description: `Retrieve calendar links for a booking that can be used to add the event to various calendar services. Returns links for Google Calendar, Microsoft Office, Microsoft Outlook, and a downloadable ICS file.
500+
501+
<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>
502+
`,
470503
})
471504
@HttpCode(HttpStatus.OK)
472505
async getCalendarLinks(@Param("bookingUid") bookingUid: string): Promise<CalendarLinksOutput_2024_08_13> {
@@ -485,6 +518,7 @@ export class BookingsController_2024_08_13 {
485518
@ApiHeader(API_KEY_OR_ACCESS_TOKEN_HEADER)
486519
@ApiOperation({
487520
summary: "Get booking references",
521+
description: `<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>`,
488522
})
489523
@HttpCode(HttpStatus.OK)
490524
async getBookingReferences(

apps/api/v2/src/ee/event-types/event-types_2024_06_14/controllers/event-types.controller.ts

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ import {
6161
@DocsTags("Event Types")
6262
@ApiHeader({
6363
name: "cal-api-version",
64-
description: `Must be set to ${VERSION_2024_06_14}`,
64+
description: `Must be set to ${VERSION_2024_06_14}. If not set to this value, the endpoint will default to an older version.`,
6565
example: VERSION_2024_06_14,
6666
required: true,
6767
schema: {
@@ -80,7 +80,10 @@ export class EventTypesController_2024_06_14 {
8080
@Permissions([EVENT_TYPE_WRITE])
8181
@UseGuards(ApiAuthGuard)
8282
@ApiHeader(API_KEY_OR_ACCESS_TOKEN_HEADER)
83-
@ApiOperation({ summary: "Create an event type" })
83+
@ApiOperation({
84+
summary: "Create an event type",
85+
description: `<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>`,
86+
})
8487
async createEventType(
8588
@Body() body: CreateEventTypeInput_2024_06_14,
8689
@GetUser() user: UserWithProfile
@@ -102,7 +105,10 @@ export class EventTypesController_2024_06_14 {
102105
@Permissions([EVENT_TYPE_READ])
103106
@UseGuards(ApiAuthGuard)
104107
@ApiHeader(API_KEY_OR_ACCESS_TOKEN_HEADER)
105-
@ApiOperation({ summary: "Get an event type" })
108+
@ApiOperation({
109+
summary: "Get an event type",
110+
description: `<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>`,
111+
})
106112
async getEventTypeById(
107113
@Param("eventTypeId") eventTypeId: string,
108114
@GetUser() user: UserWithProfile
@@ -122,8 +128,10 @@ export class EventTypesController_2024_06_14 {
122128
@Get("/")
123129
@ApiOperation({
124130
summary: "Get all event types",
125-
description:
126-
"Hidden event types are returned only if authentication is provided and it belongs to the event type owner.",
131+
description: `Hidden event types are returned only if authentication is provided and it belongs to the event type owner.
132+
133+
<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>
134+
`,
127135
})
128136
@UseGuards(OptionalApiAuthGuard)
129137
@ApiHeader(OPTIONAL_X_CAL_CLIENT_ID_HEADER)
@@ -149,7 +157,10 @@ export class EventTypesController_2024_06_14 {
149157
@UseGuards(ApiAuthGuard)
150158
@ApiHeader(API_KEY_OR_ACCESS_TOKEN_HEADER)
151159
@HttpCode(HttpStatus.OK)
152-
@ApiOperation({ summary: "Update an event type" })
160+
@ApiOperation({
161+
summary: "Update an event type",
162+
description: `<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>`,
163+
})
153164
async updateEventType(
154165
@Param("eventTypeId", ParseIntPipe) eventTypeId: number,
155166
@Body() body: UpdateEventTypeInput_2024_06_14,
@@ -173,7 +184,10 @@ export class EventTypesController_2024_06_14 {
173184
@Permissions([EVENT_TYPE_WRITE])
174185
@UseGuards(ApiAuthGuard)
175186
@ApiHeader(API_KEY_OR_ACCESS_TOKEN_HEADER)
176-
@ApiOperation({ summary: "Delete an event type" })
187+
@ApiOperation({
188+
summary: "Delete an event type",
189+
description: `<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>`,
190+
})
177191
async deleteEventType(
178192
@Param("eventTypeId") eventTypeId: number,
179193
@GetUser("id") userId: number

apps/api/v2/src/ee/schedules/schedules_2024_06_11/controllers/schedules.controller.ts

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import {
4040
@DocsTags("Schedules")
4141
@ApiHeader({
4242
name: "cal-api-version",
43-
description: `Must be set to ${VERSION_2024_06_11}`,
43+
description: `Must be set to ${VERSION_2024_06_11}. If not set to this value, the endpoint will default to an older version.`,
4444
example: VERSION_2024_06_11,
4545
required: true,
4646
schema: {
@@ -69,6 +69,8 @@ export class SchedulesController_2024_06_11 {
6969
After creating a non-default schedule, you can update an event type to point to that schedule via the PATCH \`event-types/{eventTypeId}\` endpoint.
7070
7171
When specifying start time and end time for each day use the 24 hour format e.g. 08:00, 15:00 etc.
72+
73+
<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>
7274
`,
7375
})
7476
async createSchedule(
@@ -91,7 +93,10 @@ export class SchedulesController_2024_06_11 {
9193
})
9294
@ApiOperation({
9395
summary: "Get default schedule",
94-
description: "Get the default schedule of the authenticated user.",
96+
description: `Get the default schedule of the authenticated user.
97+
98+
<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>
99+
`,
95100
})
96101
async getDefaultSchedule(@GetUser() user: UserWithProfile): Promise<GetScheduleOutput_2024_06_11> {
97102
const schedule = await this.schedulesService.getUserScheduleDefault(user.id);
@@ -104,7 +109,10 @@ export class SchedulesController_2024_06_11 {
104109

105110
@Get("/:scheduleId")
106111
@Permissions([SCHEDULE_READ])
107-
@ApiOperation({ summary: "Get a schedule" })
112+
@ApiOperation({
113+
summary: "Get a schedule",
114+
description: `<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>`,
115+
})
108116
async getSchedule(
109117
@GetUser() user: UserWithProfile,
110118
@Param("scheduleId") scheduleId: number
@@ -121,7 +129,10 @@ export class SchedulesController_2024_06_11 {
121129
@Permissions([SCHEDULE_READ])
122130
@ApiOperation({
123131
summary: "Get all schedules",
124-
description: "Get all schedules of the authenticated user.",
132+
description: `Get all schedules of the authenticated user.
133+
134+
<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>
135+
`,
125136
})
126137
async getSchedules(@GetUser() user: UserWithProfile): Promise<GetSchedulesOutput_2024_06_11> {
127138
const schedules = await this.schedulesService.getUserSchedules(user.id);
@@ -134,7 +145,10 @@ export class SchedulesController_2024_06_11 {
134145

135146
@Patch("/:scheduleId")
136147
@Permissions([SCHEDULE_WRITE])
137-
@ApiOperation({ summary: "Update a schedule" })
148+
@ApiOperation({
149+
summary: "Update a schedule",
150+
description: `<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>`,
151+
})
138152
async updateSchedule(
139153
@GetUser() user: UserWithProfile,
140154
@Body() bodySchedule: UpdateScheduleInput_2024_06_11,
@@ -155,7 +169,10 @@ export class SchedulesController_2024_06_11 {
155169
@Delete("/:scheduleId")
156170
@HttpCode(HttpStatus.OK)
157171
@Permissions([SCHEDULE_WRITE])
158-
@ApiOperation({ summary: "Delete a schedule" })
172+
@ApiOperation({
173+
summary: "Delete a schedule",
174+
description: `<Note>Please make sure to pass in the cal-api-version header value as mentioned in the Headers section. Not passing the correct value will default to an older version of this endpoint.</Note>`,
175+
})
159176
async deleteSchedule(
160177
@GetUser("id") userId: number,
161178
@Param("scheduleId") scheduleId: number

0 commit comments

Comments
 (0)