> 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 # ListDataSharingPolicies # Package: collectionManagement # Namespace: DataCollectionSharingService # Method link: https://dev.wix.com/docs/api-reference/business-solutions/cms/collection-management/data-sharing/list-data-sharing-policies.md ## Permission Scopes: Manage Data Collection Sharing: SCOPE.DATA.MANAGE_COLLECTION_SHARING ## Introduction Retrieves a list of up to 1,000 data sharing policies on the current site. Specify `dataCollectionIds` to filter policies for specific collections. --- ## REST API ### Schema ``` Method: listDataSharingPolicies Description: Retrieves a list of up to 1,000 data sharing policies on the current site. Specify `dataCollectionIds` to filter policies for specific collections. URL: https://www.wixapis.com/data/v1/data-collection-sharing/policies Method: GET Method parameters: query param name: dataCollectionIds | type: array | description: List of collection GUIDs to filter policies by. When provided, only returns policies 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. Return type: ListDataSharingPoliciesResponse - name: dataSharingPolicies | type: array | description: List of data sharing policies. - name: id | type: string | description: Data sharing policy GUID. - name: dataCollectionId | type: string | description: GUID of the data collection to share. - name: dataItemsFilter | type: object | description: Filter to restrict which items from the collection are shared. Use [API Query Language syntax](https://dev.wix.com/api/rest/getting-started/api-query-language) to define filtering rules. If not specified, all items in the collection are shared. - name: createdDate | type: string | description: Date and time the data sharing policy was created. - name: updatedDate | type: string | description: Date and time the data sharing policy 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 data sharing policies ```curl curl -X GET \ 'https://wixapis.com/wix-data/v1/data-collection-sharing/policies?dataCollectionIds=myCollection' \ -H 'Authorization: ' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.collectionManagement.DataCollectionSharingService.listDataSharingPolicies(options) Description: Retrieves a list of up to 1,000 data sharing policies on the current site. Specify `dataCollectionIds` to filter policies for specific collections. Method parameters: param name: options | type: ListDataSharingPoliciesOptions none - name: dataCollectionIds | type: array | description: List of collection GUIDs to filter policies by. When provided, only returns policies for the specified collections. - name: paging | type: CursorPaging | description: Paging information. By default, policies 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. Return type: PROMISE - name: dataSharingPolicies | type: array | description: List of data sharing policies. - name: _id | type: string | description: Data sharing policy GUID. - name: dataCollectionId | type: string | description: GUID of the data collection to share. - name: dataItemsFilter | type: object | description: Filter to restrict which items from the collection are shared. Use [API Query Language syntax](https://dev.wix.com/api/rest/getting-started/api-query-language) to define filtering rules. If not specified, all items in the collection are shared. - name: _createdDate | type: Date | description: Date and time the data sharing policy was created. - name: _updatedDate | type: Date | description: Date and time the data sharing policy 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 ### listDataSharingPolicies ```javascript import { sharing } from '@wix/data'; async function listDataSharingPolicies(options) { const response = await sharing.listDataSharingPolicies(options); }; ``` ### listDataSharingPolicies (with elevated permissions) ```javascript import { sharing } from '@wix/data'; import { auth } from '@wix/essentials'; async function myListDataSharingPoliciesMethod(options) { const elevatedListDataSharingPolicies = auth.elevate(sharing.listDataSharingPolicies); const response = await elevatedListDataSharingPolicies(options); } ``` ### listDataSharingPolicies (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 listDataSharingPolicies(options) { const response = await myWixClient.sharing.listDataSharingPolicies(options); }; ``` ---