> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # ListCalendars # Package: calendar # Namespace: ExternalCalendarService # Method link: https://dev.wix.com/docs/api-reference/business-solutions/bookings/calendar/external-calendar-v2/list-calendars.md ## Permission Scopes: Manage External Calendars: SCOPE.DC-BOOKINGS.MANAGE-EXTERNAL-CALENDARS ## Introduction Retrieves details about the external calendar accounts associated with the specified connection. --- ## REST API ### Schema ``` Method: listCalendars Description: Retrieves details about the external calendar accounts associated with the specified connection. URL: https://www.wixapis.com/bookings/v2/external-calendars/connections/{connectionId}/calendars Method: GET # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: connectionId Method parameters: param name: connectionId | type: none | required: true Return type: ListCalendarsResponse - name: calendars | type: array | description: List of calendars belonging to the external calendar account. - name: id | type: string | description: GUID of the external calendar account. - name: name | type: string | description: Display name of the external calendar account. For example, `Primary` or `Birthdays`. Possible Errors: HTTP Code: 403 | Status Code: PERMISSION_DENIED | Application Code: PREMIUM_FEATURE_NOT_ENABLED | Description: This feature requires a premium plan. Upgrade to access external calendar integration. HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: NOT_SUPPORTED_BY_PROVIDER | Description: The external calendar provider doesn't support this operation. Use a different connection method or provider. HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: CONNECTION_NOT_CONNECTED | Description: The connection isn't in a connected state. Ensure the connection is established before listing calendars. ``` ### Examples ### List calendars belonging to an external calendar account ```curl curl -X GET 'https://www.wixapis.com/bookings/v2/external-calendars/connections/4WnvD8QzxhkAjVPBKUCvLIMpbuuUCMID7rYhqOpIGDae9JYyQj0JS71sdJukve86B38sWvS6TOvMQqBxszjEMNrrx8EGfFr5KhzpkCmfjBNJx2MSLZEkgEzGqEHtRYJ92LTUJ2w5v87FG2DafDaN3VSfbRlvSEqzXlgbEapLhGsm976gGw90KJd/calendars' \ -H 'Authorization: ' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.calendar.ExternalCalendarService.listCalendars(connectionId) Description: Retrieves details about the external calendar accounts associated with the specified connection. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: connectionId Method parameters: param name: connectionId | type: string | description: GUID of the external calendar connection to list calendars for. | required: true Return type: PROMISE - name: calendars | type: array | description: List of calendars belonging to the external calendar account. - name: _id | type: string | description: GUID of the external calendar account. - name: name | type: string | description: Display name of the external calendar account. For example, `Primary` or `Birthdays`. Possible Errors: HTTP Code: 403 | Status Code: PERMISSION_DENIED | Application Code: PREMIUM_FEATURE_NOT_ENABLED | Description: This feature requires a premium plan. Upgrade to access external calendar integration. HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: NOT_SUPPORTED_BY_PROVIDER | Description: The external calendar provider doesn't support this operation. Use a different connection method or provider. HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: CONNECTION_NOT_CONNECTED | Description: The connection isn't in a connected state. Ensure the connection is established before listing calendars. ``` ### Examples ### listCalendars ```javascript import { externalCalendars } from '@wix/bookings'; async function listCalendars(connectionId) { const response = await externalCalendars.listCalendars(connectionId); }; ``` ### listCalendars (with elevated permissions) ```javascript import { externalCalendars } from '@wix/bookings'; import { auth } from '@wix/essentials'; async function myListCalendarsMethod(connectionId) { const elevatedListCalendars = auth.elevate(externalCalendars.listCalendars); const response = await elevatedListCalendars(connectionId); } ``` ### listCalendars (self-hosted) Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md). ```javascript import { createClient } from '@wix/sdk'; import { externalCalendars } from '@wix/bookings'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { externalCalendars }, // Include the auth strategy and host as relevant }); async function listCalendars(connectionId) { const response = await myWixClient.externalCalendars.listCalendars(connectionId); }; ``` ---