> 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 # ListSharedDataCollections # Package: collectionManagement # Namespace: DataCollectionSharingService # Method link: https://dev.wix.com/docs/api-reference/business-solutions/cms/collection-management/data-sharing/list-shared-data-collections.md ## Permission Scopes: Manage Data Collection Sharing: SCOPE.DATA.MANAGE_COLLECTION_SHARING ## Introduction Retrieves a list of shared data collections. Returns either the collections that are either being shared by the current site or shared with the current site. Specify `sharedWithCurrentSite` to filter the direction. --- ## REST API ### Schema ``` Method: listSharedDataCollections Description: Retrieves a list of shared data collections. Returns either the collections that are either being shared by the current site or shared with the current site. Specify `sharedWithCurrentSite` to filter the direction. URL: https://www.wixapis.com/data/v1/data-collection-sharing/shared Method: GET Method parameters: query param name: dataCollectionIds | type: array | description: List of collection GUIDs to filter by. When provided, only returns shared connections for the specified collections. param name: paging | type: CursorPaging - name: limit | type: integer | description: Number of items to load. - name: cursor | type: string | description: Pointer to the next or previous page in the list of results. You can get the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request. query param name: sharedWithCurrent | type: sharedWithCurrent | description: Whether to list collections shared with the current site or shared from the current site. query param name: sharedWithCurrentSite | type: sharedWithCurrentSite | description: Whether to list collections shared with the current site or shared from the current site. When `true`, lists collections shared with the current site. When `false`, lists collections shared from the current site's policies. Default: `false` Return type: ListSharedDataCollectionsResponse - name: connections | type: array | description: List of shared collections. - name: sourceDataCollectionId | type: string | description: GUID of the data collection owned and shared by the source site. - name: sourceSiteId | type: string | description: GUID of the source site that owns the collection and created the policy. - name: targetDataCollectionId | type: string | description: GUID of the shared collection on the target site. The GUID includes the namespace. For example, `"namespace/collectionName"`. - name: targetSiteId | type: string | description: GUID of the target site that the collection is shared with. - name: targetDisplayNamespace | type: string | description: Optional display name for the namespace that appears on the target site. - name: dataSharingPolicyId | type: string | description: GUID of the data sharing policy that controls this connection. - name: createdDate | type: string | description: Date and time the connection was created. - name: updatedDate | type: string | description: Date and time the connection was last updated. - name: pagingMetadata | type: CursorPagingMetadata | description: Paging metadata. - name: count | type: integer | description: Number of items returned in the response. - name: cursors | type: Cursors | description: Offset that was requested. - name: next | type: string | description: Cursor pointing to next page in the list of results. - name: prev | type: string | description: Cursor pointing to previous page in the list of results. - name: hasNext | type: boolean | description: Indicates if there are more results after the current page. If `true`, another page of results can be retrieved. If `false`, this is the last page. ``` ### Examples ### List shared data collections ```curl curl -X GET \ 'https://wixapis.com/wix-data/v1/data-collection-sharing/shared?sharedWithCurrentSite=false' \ -H 'Authorization: ' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.collectionManagement.DataCollectionSharingService.listSharedDataCollections(options) Description: Retrieves a list of shared data collections. Returns either the collections that are either being shared by the current site or shared with the current site. Specify `sharedWithCurrentSite` to filter the direction. Method parameters: param name: options | type: ListSharedDataCollectionsOptions none - name: dataCollectionIds | type: array | description: List of collection GUIDs to filter by. When provided, only returns shared connections for the specified collections. - name: paging | type: CursorPaging | description: Paging information. By default, shared collections are sorted by `id` in ascending order. - name: limit | type: integer | description: Number of items to load. - name: cursor | type: string | description: Pointer to the next or previous page in the list of results. You can get the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request. - name: sharedWithCurrentSite | type: boolean | description: Whether to list collections shared with the current site or shared from the current site. When `true`, lists collections shared with the current site. When `false`, lists collections shared from the current site's policies. Default: `false` Return type: PROMISE - name: connections | type: array | description: List of shared collections. - name: sourceDataCollectionId | type: string | description: GUID of the data collection owned and shared by the source site. - name: sourceSiteId | type: string | description: GUID of the source site that owns the collection and created the policy. - name: targetDataCollectionId | type: string | description: GUID of the shared collection on the target site. The GUID includes the namespace. For example, `"namespace/collectionName"`. - name: targetSiteId | type: string | description: GUID of the target site that the collection is shared with. - name: targetDisplayNamespace | type: string | description: Optional display name for the namespace that appears on the target site. - name: dataSharingPolicyId | type: string | description: GUID of the data sharing policy that controls this connection. - name: _createdDate | type: Date | description: Date and time the connection was created. - name: _updatedDate | type: Date | description: Date and time the connection was last updated. - name: pagingMetadata | type: CursorPagingMetadata | description: Paging metadata. - name: count | type: integer | description: Number of items returned in the response. - name: cursors | type: Cursors | description: Offset that was requested. - name: next | type: string | description: Cursor pointing to next page in the list of results. - name: prev | type: string | description: Cursor pointing to previous page in the list of results. - name: hasNext | type: boolean | description: Indicates if there are more results after the current page. If `true`, another page of results can be retrieved. If `false`, this is the last page. ``` ### Examples ### listSharedDataCollections ```javascript import { sharing } from '@wix/data'; async function listSharedDataCollections(options) { const response = await sharing.listSharedDataCollections(options); }; ``` ### listSharedDataCollections (with elevated permissions) ```javascript import { sharing } from '@wix/data'; import { auth } from '@wix/essentials'; async function myListSharedDataCollectionsMethod(options) { const elevatedListSharedDataCollections = auth.elevate(sharing.listSharedDataCollections); const response = await elevatedListSharedDataCollections(options); } ``` ### listSharedDataCollections (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 { sharing } from '@wix/data'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { sharing }, // Include the auth strategy and host as relevant }); async function listSharedDataCollections(options) { const response = await myWixClient.sharing.listSharedDataCollections(options); }; ``` ---