# Web Cloud › Email and Collaborative Solutions › Microsoft Exchange › Private Exchange › Shares API

> Part of the OVHcloud developer hub. Index of every page and section: https://developers.eu.ovhcloud.com/llms.txt
> The Web Cloud product's sections: https://developers.eu.ovhcloud.com/reference/web-cloud/llms.txt
> Everything in one file: https://developers.eu.ovhcloud.com/llms-full.txt

> 11 operations of the OVHcloud API. Calls carry `authorization: Bearer $OVH_TOKEN`; the EU host is shown, Canada and the United States answer on api.ca.ovhcloud.com and api.us.ovhcloud.com.

Page: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/shares/

OpenAPI v1: https://api.eu.ovhcloud.com/1.0/__schemas/developer-hub-navigation/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/shares.json?format=openapi3
OpenAPI v2: https://api.eu.ovhcloud.com/v2/__schemas/developer-hub-navigation/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/shares.json?format=openapi3

## Operations

- `GET /email/exchange/{organizationName}/service/{exchangeService}/publicFolder` — List public folders
- `GET /email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}` — Get a public folder
- `POST /email/exchange/{organizationName}/service/{exchangeService}/publicFolder` — Create a public folder
- `DELETE /email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}` — Delete a public folder
- `PUT /email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}` — Update a public folder
- `GET /email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}/permission` — List public folder permissions
- `GET /email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}/permission/{allowedAccountId}` — Get a public folder permission
- `POST /email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}/permission` — Add a public folder permission
- `DELETE /email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}/permission/{allowedAccountId}` — Remove a public folder permission
- `PUT /email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}/permission/{allowedAccountId}` — Update a public folder permission
- `GET /email/exchange/{organizationName}/service/{exchangeService}/publicFolderQuota` — Get the public folder quota

## List public folders

`GET /1.0/email/exchange/{organizationName}/service/{exchangeService}/publicFolder`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/shares/#get-email-exchange-organizationname-service-exchangeservice-publicfolder

**Status:** Stable production version  
**IAM actions:** `emailExchange:apiovh:service/publicFolder/get`

List public folders. Returns the paths of the public folders of the service. Filter them by `path` to look for a given folder.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `organizationName` | path | string | yes | The internal name of your exchange organization |
| `path` | query | string |  | Filter the value of path property (like) |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | string[] | successful operation |

```json
[
  "string"
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/email/exchange/{organizationName}/service/{exchangeService}/publicFolder" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/email/exchange/{organizationName}/service/{exchangeService}/publicFolder")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/email/exchange/{organizationName}/service/{exchangeService}/publicFolder");

print_r($result);
?>
```

## Get a public folder

`GET /1.0/email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/shares/#get-email-exchange-organizationname-service-exchangeservice-publicfolder-path

**Status:** Stable production version  
**IAM actions:** `emailExchange:apiovh:service/publicFolder/get`

Get a public folder. Returns the type, quota, size, item count, default and anonymous permissions and access dates of the public folder.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `organizationName` | path | string | yes | The internal name of your exchange organization |
| `path` | path | string | yes | Path for public folder |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.exchange.publicFolder | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `anonymousPermission` | email.exchange.PublicFolderRightTypeEnum |  | Access right for the guest users — one of `editor`, `none`, `reviewer` |
| `creationDate` | string (date-time) | read-only | Creation date |
| `defaultPermission` | email.exchange.PublicFolderRightTypeEnum |  | Default access right — one of `editor`, `none`, `reviewer` |
| `hasSubFolders` | boolean | read-only | If true, this public folder has subfolders |
| `itemCount` | integer | read-only | Number of items in public folder |
| `lastAccessTime` | string (date-time) | read-only | Time for which public folder was accessed for the last time |
| `lastModificationTime` | string (date-time) | read-only | Time for which public folder was modified for the last time |
| `lastUserAccessTime` | string (date-time) | read-only | Time for which public folder was accessed for the last time by the user |
| `lastUserModificationTime` | string (date-time) | read-only | Time for which public folder was modified for the last time by the user |
| `path` | string | read-only | Path for public folder |
| `quota` | integer |  | Quota for public folder in MB |
| `state` | email.exchange.ObjectStateEnum | read-only | Current object state — one of `creating`, `deleting`, `internalMigration`, `ok`, `reopening`, `suspended`, `suspending` |
| `taskPendingId` | integer | read-only | task pending id |
| `totalItemSize` | integer | read-only | Sum of all items in public folder in MB |
| `type` | email.exchange.PublicFolderTypeEnum | read-only | Type for public folder — one of `calendar`, `contacts`, `plain`, `tasks` |

```json
{
  "anonymousPermission": "editor",
  "creationDate": "2024-01-01T12:00:00Z",
  "defaultPermission": "editor",
  "hasSubFolders": true,
  "itemCount": 0,
  "lastAccessTime": "2024-01-01T12:00:00Z",
  "lastModificationTime": "2024-01-01T12:00:00Z",
  "lastUserAccessTime": "2024-01-01T12:00:00Z",
  "lastUserModificationTime": "2024-01-01T12:00:00Z",
  "path": "string",
  "quota": 0,
  "state": "creating",
  "taskPendingId": 0,
  "totalItemSize": 0,
  "type": "calendar"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}");

print_r($result);
?>
```

## Create a public folder

`POST /1.0/email/exchange/{organizationName}/service/{exchangeService}/publicFolder`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/shares/#post-email-exchange-organizationname-service-exchangeservice-publicfolder

**Status:** Stable production version  
**IAM actions:** `emailExchange:apiovh:service/publicFolder/create`

Create a public folder. Creates a calendar, contacts, plain or tasks public folder from its `path` and its `quota` in MB, and returns the task.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `organizationName` | path | string | yes | The internal name of your exchange organization |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `anonymousPermission` | email.exchange.PublicFolderRightTypeEnum |  | Access right for the guest users — one of `editor`, `none`, `reviewer` |
| `defaultPermission` | email.exchange.PublicFolderRightTypeEnum |  | Default access right — one of `editor`, `none`, `reviewer` |
| `path` | string | yes | Path for public folder |
| `quota` | integer | yes | Quota for public folder in MB |
| `type` | email.exchange.PublicFolderTypeEnum | yes | Type for public folder — one of `calendar`, `contacts`, `plain`, `tasks` |

```json
{
  "anonymousPermission": "editor",
  "defaultPermission": "editor",
  "path": "string",
  "quota": 0,
  "type": "calendar"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.exchange.Task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `finishDate` | string (date-time) | read-only | Completion date |
| `function` | email.exchange.TaskFunctionEnum | read-only | Function name — one of `activateSharepoint`, `addAccount`, `addAccountArchive`, `addAccountImpersonation`, `addActiveSyncMailNotification`, `addAlias`, `addDistributionGroup`, `addDistributionGroupManager`, `addDistributionGroupMember`, `addDistributionGroupSendAs`, `addDistributionGroupSendOnBehalfTo`, `addDomain`, … |
| `id` | integer | read-only | Task id |
| `status` | email.exchange.TaskStatusEnum | read-only | Task status — one of `cancelled`, `doing`, `done`, `error`, `todo` |
| `todoDate` | string (date-time) | read-only | Creation date |

```json
{
  "finishDate": "2024-01-01T12:00:00Z",
  "function": "activateSharepoint",
  "id": 0,
  "status": "cancelled",
  "todoDate": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/email/exchange/{organizationName}/service/{exchangeService}/publicFolder" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: email.exchange.PublicFolderTypeEnum
result = client.post("/email/exchange/{organizationName}/service/{exchangeService}/publicFolder",
	anonymousPermission = None, # Access right for the guest users (type: email.exchange.PublicFolderRightTypeEnum, nullable)
	defaultPermission = None, # Default access right (type: email.exchange.PublicFolderRightTypeEnum, nullable)
	path = None, # Path for public folder (type: string)
	quota = None, # Quota for public folder in MB (type: long)
	type = None, # Type for public folder (type: email.exchange.PublicFolderTypeEnum)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: email.exchange.PublicFolderTypeEnum
$result = $ovh->post("/email/exchange/{organizationName}/service/{exchangeService}/publicFolder", array(
	anonymousPermission => null, // Access right for the guest users (type: email.exchange.PublicFolderRightTypeEnum, nullable)
	defaultPermission => null, // Default access right (type: email.exchange.PublicFolderRightTypeEnum, nullable)
	path => null, // Path for public folder (type: string)
	quota => null, // Quota for public folder in MB (type: long)
	type => null, // Type for public folder (type: email.exchange.PublicFolderTypeEnum)
));

print_r($result);
?>
```

## Delete a public folder

`DELETE /1.0/email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/shares/#delete-email-exchange-organizationname-service-exchangeservice-publicfolder-path

**Status:** Stable production version  
**IAM actions:** `emailExchange:apiovh:service/publicFolder/delete`

Delete a public folder. Deletes the public folder with its content and permissions, and returns the task.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `organizationName` | path | string | yes | The internal name of your exchange organization |
| `path` | path | string | yes | Path for public folder |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.exchange.Task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `finishDate` | string (date-time) | read-only | Completion date |
| `function` | email.exchange.TaskFunctionEnum | read-only | Function name — one of `activateSharepoint`, `addAccount`, `addAccountArchive`, `addAccountImpersonation`, `addActiveSyncMailNotification`, `addAlias`, `addDistributionGroup`, `addDistributionGroupManager`, `addDistributionGroupMember`, `addDistributionGroupSendAs`, `addDistributionGroupSendOnBehalfTo`, `addDomain`, … |
| `id` | integer | read-only | Task id |
| `status` | email.exchange.TaskStatusEnum | read-only | Task status — one of `cancelled`, `doing`, `done`, `error`, `todo` |
| `todoDate` | string (date-time) | read-only | Creation date |

```json
{
  "finishDate": "2024-01-01T12:00:00Z",
  "function": "activateSharepoint",
  "id": 0,
  "status": "cancelled",
  "todoDate": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/1.0/email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.delete("/email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->delete("/email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}");

print_r($result);
?>
```

## Update a public folder

`PUT /1.0/email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/shares/#put-email-exchange-organizationname-service-exchangeservice-publicfolder-path

**Status:** Stable production version  
**IAM actions:** `emailExchange:apiovh:service/publicFolder/edit`

Update a public folder. Updates the quota of the public folder, in MB, and its default and anonymous permissions.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `organizationName` | path | string | yes | The internal name of your exchange organization |
| `path` | path | string | yes | Path for public folder |

### Request body (required)

Type: `email.exchange.publicFolder`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `anonymousPermission` | email.exchange.PublicFolderRightTypeEnum |  | Access right for the guest users — one of `editor`, `none`, `reviewer` |
| `creationDate` | string (date-time) | read-only | Creation date |
| `defaultPermission` | email.exchange.PublicFolderRightTypeEnum |  | Default access right — one of `editor`, `none`, `reviewer` |
| `hasSubFolders` | boolean | read-only | If true, this public folder has subfolders |
| `itemCount` | integer | read-only | Number of items in public folder |
| `lastAccessTime` | string (date-time) | read-only | Time for which public folder was accessed for the last time |
| `lastModificationTime` | string (date-time) | read-only | Time for which public folder was modified for the last time |
| `lastUserAccessTime` | string (date-time) | read-only | Time for which public folder was accessed for the last time by the user |
| `lastUserModificationTime` | string (date-time) | read-only | Time for which public folder was modified for the last time by the user |
| `path` | string | read-only | Path for public folder |
| `quota` | integer |  | Quota for public folder in MB |
| `state` | email.exchange.ObjectStateEnum | read-only | Current object state — one of `creating`, `deleting`, `internalMigration`, `ok`, `reopening`, `suspended`, `suspending` |
| `taskPendingId` | integer | read-only | task pending id |
| `totalItemSize` | integer | read-only | Sum of all items in public folder in MB |
| `type` | email.exchange.PublicFolderTypeEnum | read-only | Type for public folder — one of `calendar`, `contacts`, `plain`, `tasks` |

```json
{
  "anonymousPermission": "editor",
  "defaultPermission": "editor",
  "quota": 0
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | — | successful operation |

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/1.0/email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: email.exchange.publicFolder
result = client.put("/email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}",
	anonymousPermission = None, # Access right for the guest users (type: email.exchange.PublicFolderRightTypeEnum)
	defaultPermission = None, # Default access right (type: email.exchange.PublicFolderRightTypeEnum)
	quota = None, # Quota for public folder in MB (type: integer)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: email.exchange.publicFolder
$result = $ovh->put("/email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}", array(
	anonymousPermission => null, // Access right for the guest users (type: email.exchange.PublicFolderRightTypeEnum)
	defaultPermission => null, // Default access right (type: email.exchange.PublicFolderRightTypeEnum)
	quota => null, // Quota for public folder in MB (type: integer)
));

print_r($result);
?>
```

## List public folder permissions

`GET /1.0/email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}/permission`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/shares/#get-email-exchange-organizationname-service-exchangeservice-publicfolder-path-permission

**Status:** Stable production version  
**IAM actions:** `emailExchange:apiovh:service/publicFolder/permission/get`

List public folder permissions. Returns the IDs of the accounts that have a permission on the public folder.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `organizationName` | path | string | yes | The internal name of your exchange organization |
| `path` | path | string | yes | Path for public folder |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | integer[] | successful operation |

```json
[
  0
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}/permission" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}/permission")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}/permission");

print_r($result);
?>
```

## Get a public folder permission

`GET /1.0/email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}/permission/{allowedAccountId}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/shares/#get-email-exchange-organizationname-service-exchangeservice-publicfolder-path-permission-allowedaccountid

**Status:** Stable production version  
**IAM actions:** `emailExchange:apiovh:service/publicFolder/permission/get`

Get a public folder permission. Returns the ID of the account given access to the public folder, its access rights and its state.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `allowedAccountId` | path | integer | yes | Account id |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `organizationName` | path | string | yes | The internal name of your exchange organization |
| `path` | path | string | yes | Path for public folder |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.exchange.exchangePublicFolderPermission | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `accessRights` | email.exchange.PublicFolderRightTypeEnum |  | Access right set for the account — one of `editor`, `none`, `reviewer` |
| `allowedAccountId` | integer | read-only | Account id |
| `creationDate` | string (date-time) | read-only | Creation date |
| `state` | email.exchange.ObjectStateEnum | read-only | Current object state — one of `creating`, `deleting`, `internalMigration`, `ok`, `reopening`, `suspended`, `suspending` |
| `taskPendingId` | integer | read-only | task pending id |

```json
{
  "accessRights": "editor",
  "allowedAccountId": 0,
  "creationDate": "2024-01-01T12:00:00Z",
  "state": "creating",
  "taskPendingId": 0
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}/permission/{allowedAccountId}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}/permission/{allowedAccountId}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}/permission/{allowedAccountId}");

print_r($result);
?>
```

## Add a public folder permission

`POST /1.0/email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}/permission`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/shares/#post-email-exchange-organizationname-service-exchangeservice-publicfolder-path-permission

**Status:** Stable production version  
**IAM actions:** `emailExchange:apiovh:service/publicFolder/permission/create`

Add a public folder permission. Gives the account given by `allowedAccountId` the editor, reviewer or none access right on the public folder, and returns the task.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `organizationName` | path | string | yes | The internal name of your exchange organization |
| `path` | path | string | yes | Path for public folder |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `accessRights` | email.exchange.PublicFolderRightTypeEnum | yes | Access rights to be set for the account — one of `editor`, `none`, `reviewer` |
| `allowedAccountId` | integer | yes | Account id to have access to public folder |

```json
{
  "accessRights": "editor",
  "allowedAccountId": 0
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.exchange.Task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `finishDate` | string (date-time) | read-only | Completion date |
| `function` | email.exchange.TaskFunctionEnum | read-only | Function name — one of `activateSharepoint`, `addAccount`, `addAccountArchive`, `addAccountImpersonation`, `addActiveSyncMailNotification`, `addAlias`, `addDistributionGroup`, `addDistributionGroupManager`, `addDistributionGroupMember`, `addDistributionGroupSendAs`, `addDistributionGroupSendOnBehalfTo`, `addDomain`, … |
| `id` | integer | read-only | Task id |
| `status` | email.exchange.TaskStatusEnum | read-only | Task status — one of `cancelled`, `doing`, `done`, `error`, `todo` |
| `todoDate` | string (date-time) | read-only | Creation date |

```json
{
  "finishDate": "2024-01-01T12:00:00Z",
  "function": "activateSharepoint",
  "id": 0,
  "status": "cancelled",
  "todoDate": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}/permission" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.post("/email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}/permission",
	accessRights = None, # Access rights to be set for the account (type: email.exchange.PublicFolderRightTypeEnum)
	allowedAccountId = None, # Account id to have access to public folder (type: long)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->post("/email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}/permission", array(
	accessRights => null, // Access rights to be set for the account (type: email.exchange.PublicFolderRightTypeEnum)
	allowedAccountId => null, // Account id to have access to public folder (type: long)
));

print_r($result);
?>
```

## Remove a public folder permission

`DELETE /1.0/email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}/permission/{allowedAccountId}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/shares/#delete-email-exchange-organizationname-service-exchangeservice-publicfolder-path-permission-allowedaccountid

**Status:** Stable production version  
**IAM actions:** `emailExchange:apiovh:service/publicFolder/permission/delete`

Remove a public folder permission. Withdraws the access of the account to the public folder, and returns the task.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `allowedAccountId` | path | integer | yes | Account id |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `organizationName` | path | string | yes | The internal name of your exchange organization |
| `path` | path | string | yes | Path for public folder |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.exchange.Task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `finishDate` | string (date-time) | read-only | Completion date |
| `function` | email.exchange.TaskFunctionEnum | read-only | Function name — one of `activateSharepoint`, `addAccount`, `addAccountArchive`, `addAccountImpersonation`, `addActiveSyncMailNotification`, `addAlias`, `addDistributionGroup`, `addDistributionGroupManager`, `addDistributionGroupMember`, `addDistributionGroupSendAs`, `addDistributionGroupSendOnBehalfTo`, `addDomain`, … |
| `id` | integer | read-only | Task id |
| `status` | email.exchange.TaskStatusEnum | read-only | Task status — one of `cancelled`, `doing`, `done`, `error`, `todo` |
| `todoDate` | string (date-time) | read-only | Creation date |

```json
{
  "finishDate": "2024-01-01T12:00:00Z",
  "function": "activateSharepoint",
  "id": 0,
  "status": "cancelled",
  "todoDate": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/1.0/email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}/permission/{allowedAccountId}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.delete("/email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}/permission/{allowedAccountId}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->delete("/email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}/permission/{allowedAccountId}");

print_r($result);
?>
```

## Update a public folder permission

`PUT /1.0/email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}/permission/{allowedAccountId}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/shares/#put-email-exchange-organizationname-service-exchangeservice-publicfolder-path-permission-allowedaccountid

**Status:** Stable production version  
**IAM actions:** `emailExchange:apiovh:service/publicFolder/permission/edit`

Update a public folder permission. Sets the access right of the account on the public folder: editor, reviewer or none.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `allowedAccountId` | path | integer | yes | Account id |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `organizationName` | path | string | yes | The internal name of your exchange organization |
| `path` | path | string | yes | Path for public folder |

### Request body (required)

Type: `email.exchange.exchangePublicFolderPermission`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `accessRights` | email.exchange.PublicFolderRightTypeEnum |  | Access right set for the account — one of `editor`, `none`, `reviewer` |
| `allowedAccountId` | integer | read-only | Account id |
| `creationDate` | string (date-time) | read-only | Creation date |
| `state` | email.exchange.ObjectStateEnum | read-only | Current object state — one of `creating`, `deleting`, `internalMigration`, `ok`, `reopening`, `suspended`, `suspending` |
| `taskPendingId` | integer | read-only | task pending id |

```json
{
  "accessRights": "editor"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | — | successful operation |

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/1.0/email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}/permission/{allowedAccountId}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: email.exchange.exchangePublicFolderPermission
result = client.put("/email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}/permission/{allowedAccountId}",
	accessRights = None, # Access right set for the account (type: email.exchange.PublicFolderRightTypeEnum)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: email.exchange.exchangePublicFolderPermission
$result = $ovh->put("/email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}/permission/{allowedAccountId}", array(
	accessRights => null, // Access right set for the account (type: email.exchange.PublicFolderRightTypeEnum)
));

print_r($result);
?>
```

## Get the public folder quota

`GET /1.0/email/exchange/{organizationName}/service/{exchangeService}/publicFolderQuota`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/shares/#get-email-exchange-organizationname-service-exchangeservice-publicfolderquota

**Status:** Stable production version  
**IAM actions:** `emailExchange:apiovh:service/publicFolderQuota/get`

Get the public folder quota. Returns the total space of the public folders, the space already reserved and the space used, in MB.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `organizationName` | path | string | yes | The internal name of your exchange organization |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.exchange.PublicFolderQuota | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `quotaLimit` | integer |  | total amount of space in MB for public folders within organization |
| `quotaReserved` | integer |  | space in MB already reserved from the quota limit |
| `quotaUsed` | integer |  | currently used space in MB within all public folders |

```json
{
  "quotaLimit": 0,
  "quotaReserved": 0,
  "quotaUsed": 0
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/email/exchange/{organizationName}/service/{exchangeService}/publicFolderQuota" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/email/exchange/{organizationName}/service/{exchangeService}/publicFolderQuota")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/email/exchange/{organizationName}/service/{exchangeService}/publicFolderQuota");

print_r($result);
?>
```
