> 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 # GetDataSharingPolicy # Package: collectionManagement # Namespace: DataCollectionSharingService # Method link: https://dev.wix.com/docs/api-reference/business-solutions/cms/collection-management/data-sharing/get-data-sharing-policy.md ## Permission Scopes: Manage Data Collection Sharing: SCOPE.DATA.MANAGE_COLLECTION_SHARING ## Introduction Retrieves a data sharing policy specified by ID. --- ## REST API ### Schema ``` Method: getDataSharingPolicy Description: Retrieves a data sharing policy specified by GUID. URL: https://www.wixapis.com/data/v1/data-collection-sharing/policies/{dataSharingPolicyId} Method: GET # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: dataSharingPolicyId Method parameters: param name: dataSharingPolicyId | type: none | required: true Return type: GetDataSharingPolicyResponse - name: dataSharingPolicy | type: DataSharingPolicy | description: Retrieved data sharing policy. - 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. Possible Errors: HTTP Code: 403 | Status Code: PERMISSION_DENIED | Application Code: WDE0144 | Description: Permissions denied. Must have `MANAGE DATA COLLECTION SHARING` permission. HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: WDE0154 | Description: Data sharing policy not found. Verify the policy GUID is correct and is owned by the current site. ``` ### Examples ### Get data sharing policy ```curl curl -X GET \ 'https://wixapis.com/wix-data/v1/data-collection-sharing/policies/f6d058c0-6d5a-4ca5-b4a6-24933fce9175' \ -H 'Authorization: ' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.collectionManagement.DataCollectionSharingService.getDataSharingPolicy(dataSharingPolicyId) Description: Retrieves a data sharing policy specified by GUID. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: dataSharingPolicyId Method parameters: param name: dataSharingPolicyId | type: string | description: Data sharing policy GUID. | required: true Return type: PROMISE - 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. Possible Errors: HTTP Code: 403 | Status Code: PERMISSION_DENIED | Application Code: WDE0144 | Description: Permissions denied. Must have `MANAGE DATA COLLECTION SHARING` permission. HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: WDE0154 | Description: Data sharing policy not found. Verify the policy GUID is correct and is owned by the current site. ``` ### Examples ### getDataSharingPolicy ```javascript import { sharing } from '@wix/data'; async function getDataSharingPolicy(dataSharingPolicyId) { const response = await sharing.getDataSharingPolicy(dataSharingPolicyId); }; ``` ### getDataSharingPolicy (with elevated permissions) ```javascript import { sharing } from '@wix/data'; import { auth } from '@wix/essentials'; async function myGetDataSharingPolicyMethod(dataSharingPolicyId) { const elevatedGetDataSharingPolicy = auth.elevate(sharing.getDataSharingPolicy); const response = await elevatedGetDataSharingPolicy(dataSharingPolicyId); } ``` ### getDataSharingPolicy (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 getDataSharingPolicy(dataSharingPolicyId) { const response = await myWixClient.sharing.getDataSharingPolicy(dataSharingPolicyId); }; ``` ---