> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> 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`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - 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.  | read-only: true | validation: format GUID
     - name: dataCollectionId | type: string | description: GUID of the data collection to share.  | validation: maxLength 255, immutable
     - 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.  | read-only: true | validation: format date-time
     - name: updatedDate | type: string | description: Date and time the data sharing policy was last updated.  | read-only: true | validation: format date-time

 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: <AUTH>'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.data.sharing.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 | validation: format GUID
 Return type: PROMISE<DataSharingPolicy>
  - name: _id | type: string | description: Data sharing policy GUID.  | read-only: true | validation: format GUID
  - name: dataCollectionId | type: string | description: GUID of the data collection to share.  | validation: maxLength 255, immutable
  - 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.  | read-only: true 
  - name: _updatedDate | type: Date | description: Date and time the data sharing policy was last updated.  | read-only: true 

 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-managed)
Self-managed 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);
};
```

---