# Web Cloud › Email and Collaborative Solutions › Microsoft Exchange › Trusted Exchange › General Information 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

> 19 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/trusted-exchange/general-information/

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

## Operations

- `GET /email/exchange` — List Exchange organizations
- `GET /email/exchange/{organizationName}/service` — List Exchange services
- `GET /email/exchange/{organizationName}/service/{exchangeService}` — Get the Exchange service
- `PUT /email/exchange/{organizationName}/service/{exchangeService}` — Update the Exchange service
- `GET /email/exchange/{organizationName}/service/{exchangeService}/dcvEmails` — List DCV emails
- `GET /email/exchange/{organizationName}/service/{exchangeService}/license` — List active licenses
- `GET /email/exchange/{organizationName}/service/{exchangeService}/outlookAvailability` — List available Outlook versions
- `POST /email/exchange/{organizationName}/service/{exchangeService}/renewSSL` — Renew the SSL certificate
- `GET /email/exchange/{organizationName}/service/{exchangeService}/server` — Get the server
- `PUT /email/exchange/{organizationName}/service/{exchangeService}/server` — Update the server
- `GET /email/exchange/{organizationName}/service/{exchangeService}/serviceInfos` — Get service information
- `PUT /email/exchange/{organizationName}/service/{exchangeService}/serviceInfos` — Update service information
- `GET /msServices` — List Active Directory services
- `GET /msServices/{serviceName}` — Get an Active Directory service
- `PUT /msServices/{serviceName}` — Update an Active Directory service
- `POST /msServices/{serviceName}/changeContact` — Change service contacts
- `GET /msServices/{serviceName}/exchange` — Get the linked Exchange service
- `PUT /msServices/{serviceName}/exchange` — Update the linked Exchange service
- `GET /msServices/{serviceName}/exchange/billingMigrated` — Check the billing migration

## List Exchange organizations

`GET /1.0/email/exchange`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/general-information/#get-email-exchange

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

List Exchange organizations. Returns the names of the Exchange organizations of the account. Each organization holds one or more services.

### Responses

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

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

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/email/exchange" \
  -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")

# 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");

print_r($result);
?>
```

## List Exchange services

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

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/general-information/#get-email-exchange-organizationname-service

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

List Exchange services. Returns the names of the Exchange services of the organization. Filter them by IAM tags with `iamTags`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `iamTags` | query | object |  | Filter resources on IAM tags |
| `organizationName` | path | string | yes | The internal name of your exchange organization |

### 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" \
  -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")

# 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");

print_r($result);
?>
```

## Get the Exchange service

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

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

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

Get the Exchange service. Returns the offer, state, hostname, display name, password and lockout policy, message size limits, spam and virus settings and SSL expiration date of the service.

### 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.ExchangeServiceWithIAM | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `adfsChangePassword` | boolean |  | Enable or disable password change via ADFS |
| `cnameDcvRecord` | string | read-only | DNS Domain Control Validation record, require for order ssl varification process |
| `complexityEnabled` | boolean |  | enable policy for strong and secure passwords |
| `defaultAuthenticationPolicyId` | integer |  | ID of the authentication policy to apply on a new Exchange account |
| `defaultSmartHost` | string | read-only | Relay domain address that can be used to send all e-mails via default send connector |
| `displayName` | string |  | service displayName |
| `domain` | string | read-only |  |
| `hostname` | string | read-only |  |
| `iam` | iam.ResourceMetadata | read-only | IAM resource metadata |
| `iam.displayName` | string | read-only | Resource display name |
| `iam.id` | string (uuid) | read-only | Unique identifier of the resource |
| `iam.state` | iam.ResourceMetadata.StateEnum | read-only | Resource state — one of `EXPIRED`, `IN_CREATION`, `OK`, `SUSPENDED` |
| `iam.tags` | object | read-only | Resource tags. Tags that were internally computed are prefixed with ovh: |
| `iam.urn` | string | read-only | Unique resource name used in policies |
| `lastUpdateDate` | string (date-time) | read-only | Update date |
| `lockoutDuration` | integer |  | number of minutes account will remain locked if it occurs |
| `lockoutObservationWindow` | integer |  | number of minutes that must elapse after a failed logon to reset lockout trigger |
| `lockoutThreshold` | integer |  | number of attempts before account to be locked |
| `maxPasswordAge` | integer |  | maximum number of days that account's password is valid before expiration |
| `maxReceiveSize` | integer |  | Maximum message size that You can receive in MB |
| `maxSendSize` | integer |  | Maximum message size that You can send in MB |
| `minPasswordAge` | integer |  | minimum number of days before able to change account's password |
| `minPasswordLength` | integer |  | minimum number of characters password must contain |
| `offer` | email.exchange.ServiceOfferEnum | read-only | Service Offer name — one of `dedicated`, `dedicatedCluster`, `hosted`, `provider` |
| `passwordHistoryCount` | integer |  | number of historical password that cannot be reused |
| `spamAndVirusConfiguration` | email.exchange.spamAndVirusConfiguration |  | Spam and Antivirus configuration |
| `spamAndVirusConfiguration.checkDKIM` | boolean |  | Check DKIM of message |
| `spamAndVirusConfiguration.checkSPF` | boolean |  | Check SPF of message |
| `spamAndVirusConfiguration.deleteSpam` | boolean |  | If message is a spam delete it |
| `spamAndVirusConfiguration.deleteVirus` | boolean |  | If message is a virus delete it |
| `spamAndVirusConfiguration.putInJunk` | boolean |  | If message is a spam or virus put in junk. Overridden by deleteSpam or deleteVirus |
| `spamAndVirusConfiguration.tagSpam` | boolean |  | If message is a spam change its subject |
| `spamAndVirusConfiguration.tagVirus` | boolean |  | If message is a virus change its subject |
| `sslExpirationDate` | string (date) | read-only |  |
| `state` | email.exchange.ServiceStateEnum | read-only | Exchange Service State — one of `inMaintenance`, `ok`, `suspended` |
| `taskPendingId` | integer | read-only | Task pending id |
| `webUrl` | string | read-only | URL for web interface |

```json
{
  "adfsChangePassword": true,
  "cnameDcvRecord": "string",
  "complexityEnabled": true,
  "defaultAuthenticationPolicyId": 0,
  "defaultSmartHost": "string",
  "displayName": "string",
  "domain": "string",
  "hostname": "string",
  "iam": {
    "displayName": "string",
    "id": "00000000-0000-0000-0000-000000000000",
    "state": "EXPIRED",
    "tags": {
      "key": "string"
    },
    "urn": "string"
  },
  "lastUpdateDate": "2024-01-01T12:00:00Z",
  "lockoutDuration": 0,
  "lockoutObservationWindow": 0,
  "lockoutThreshold": 0,
  "maxPasswordAge": 0,
  "maxReceiveSize": 0,
  "maxSendSize": 0,
  "minPasswordAge": 0,
  "minPasswordLength": 0,
  "offer": "dedicated",
  "passwordHistoryCount": 0,
  "spamAndVirusConfiguration": {
    "checkDKIM": true,
    "checkSPF": true,
    "deleteSpam": true,
    "deleteVirus": true,
    "putInJunk": true,
    "tagSpam": true,
    "tagVirus": true
  },
  "sslExpirationDate": "2024-01-01",
  "state": "inMaintenance",
  "taskPendingId": 0,
  "webUrl": "string"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/email/exchange/{organizationName}/service/{exchangeService}" \
  -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}")

# 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}");

print_r($result);
?>
```

## Update the Exchange service

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

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/general-information/#put-email-exchange-organizationname-service-exchangeservice

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

Update the Exchange service. Updates the display name, password and lockout policy, message size limits, spam and virus settings, ADFS password change and default authentication policy of the service.

### 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: `email.exchange.ExchangeService`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `adfsChangePassword` | boolean |  | Enable or disable password change via ADFS |
| `cnameDcvRecord` | string | read-only | DNS Domain Control Validation record, require for order ssl varification process |
| `complexityEnabled` | boolean |  | enable policy for strong and secure passwords |
| `defaultAuthenticationPolicyId` | integer |  | ID of the authentication policy to apply on a new Exchange account |
| `defaultSmartHost` | string | read-only | Relay domain address that can be used to send all e-mails via default send connector |
| `displayName` | string |  | service displayName |
| `domain` | string | read-only |  |
| `hostname` | string | read-only |  |
| `lastUpdateDate` | string (date-time) | read-only | Update date |
| `lockoutDuration` | integer |  | number of minutes account will remain locked if it occurs |
| `lockoutObservationWindow` | integer |  | number of minutes that must elapse after a failed logon to reset lockout trigger |
| `lockoutThreshold` | integer |  | number of attempts before account to be locked |
| `maxPasswordAge` | integer |  | maximum number of days that account's password is valid before expiration |
| `maxReceiveSize` | integer |  | Maximum message size that You can receive in MB |
| `maxSendSize` | integer |  | Maximum message size that You can send in MB |
| `minPasswordAge` | integer |  | minimum number of days before able to change account's password |
| `minPasswordLength` | integer |  | minimum number of characters password must contain |
| `offer` | email.exchange.ServiceOfferEnum | read-only | Service Offer name — one of `dedicated`, `dedicatedCluster`, `hosted`, `provider` |
| `passwordHistoryCount` | integer |  | number of historical password that cannot be reused |
| `spamAndVirusConfiguration` | email.exchange.spamAndVirusConfiguration |  | Spam and Antivirus configuration |
| `spamAndVirusConfiguration.checkDKIM` | boolean |  | Check DKIM of message |
| `spamAndVirusConfiguration.checkSPF` | boolean |  | Check SPF of message |
| `spamAndVirusConfiguration.deleteSpam` | boolean |  | If message is a spam delete it |
| `spamAndVirusConfiguration.deleteVirus` | boolean |  | If message is a virus delete it |
| `spamAndVirusConfiguration.putInJunk` | boolean |  | If message is a spam or virus put in junk. Overridden by deleteSpam or deleteVirus |
| `spamAndVirusConfiguration.tagSpam` | boolean |  | If message is a spam change its subject |
| `spamAndVirusConfiguration.tagVirus` | boolean |  | If message is a virus change its subject |
| `sslExpirationDate` | string (date) | read-only |  |
| `state` | email.exchange.ServiceStateEnum | read-only | Exchange Service State — one of `inMaintenance`, `ok`, `suspended` |
| `taskPendingId` | integer | read-only | Task pending id |
| `webUrl` | string | read-only | URL for web interface |

```json
{
  "adfsChangePassword": true,
  "complexityEnabled": true,
  "defaultAuthenticationPolicyId": 0,
  "displayName": "string",
  "lockoutDuration": 0,
  "lockoutObservationWindow": 0,
  "lockoutThreshold": 0,
  "maxPasswordAge": 0,
  "maxReceiveSize": 0,
  "maxSendSize": 0,
  "minPasswordAge": 0,
  "minPasswordLength": 0,
  "passwordHistoryCount": 0,
  "spamAndVirusConfiguration": {
    "checkDKIM": true,
    "checkSPF": true,
    "deleteSpam": true,
    "deleteVirus": true,
    "putInJunk": true,
    "tagSpam": true,
    "tagVirus": true
  }
}
```

### Responses

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

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/1.0/email/exchange/{organizationName}/service/{exchangeService}" \
  -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.ExchangeService
result = client.put("/email/exchange/{organizationName}/service/{exchangeService}",
	adfsChangePassword = None, # Enable or disable password change via ADFS (type: boolean)
	complexityEnabled = None, # enable policy for strong and secure passwords (type: boolean)
	defaultAuthenticationPolicyId = None, # ID of the authentication policy to apply on a new Exchange account (type: integer, nullable)
	displayName = None, # service displayName (type: string, nullable)
	lockoutDuration = None, # number of minutes account will remain locked if it occurs (type: integer)
	lockoutObservationWindow = None, # number of minutes that must elapse after a failed logon to reset lockout trigger (type: integer)
	lockoutThreshold = None, # number of attempts before account to be locked (type: integer, nullable)
	maxPasswordAge = None, # maximum number of days that account's password is valid before expiration (type: integer, nullable)
	maxReceiveSize = None, # Maximum message size that You can receive in MB (type: integer)
	maxSendSize = None, # Maximum message size that You can send in MB (type: integer)
	minPasswordAge = None, # minimum number of days before able to change account's password (type: integer, nullable)
	minPasswordLength = None, # minimum number of characters password must contain (type: integer, nullable)
	passwordHistoryCount = None, # number of historical password that cannot be reused (type: integer, nullable)
	spamAndVirusConfiguration = None, # Spam and Antivirus configuration (type: email.exchange.spamAndVirusConfiguration)
)

# 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.ExchangeService
$result = $ovh->put("/email/exchange/{organizationName}/service/{exchangeService}", array(
	adfsChangePassword => null, // Enable or disable password change via ADFS (type: boolean)
	complexityEnabled => null, // enable policy for strong and secure passwords (type: boolean)
	defaultAuthenticationPolicyId => null, // ID of the authentication policy to apply on a new Exchange account (type: integer, nullable)
	displayName => null, // service displayName (type: string, nullable)
	lockoutDuration => null, // number of minutes account will remain locked if it occurs (type: integer)
	lockoutObservationWindow => null, // number of minutes that must elapse after a failed logon to reset lockout trigger (type: integer)
	lockoutThreshold => null, // number of attempts before account to be locked (type: integer, nullable)
	maxPasswordAge => null, // maximum number of days that account's password is valid before expiration (type: integer, nullable)
	maxReceiveSize => null, // Maximum message size that You can receive in MB (type: integer)
	maxSendSize => null, // Maximum message size that You can send in MB (type: integer)
	minPasswordAge => null, // minimum number of days before able to change account's password (type: integer, nullable)
	minPasswordLength => null, // minimum number of characters password must contain (type: integer, nullable)
	passwordHistoryCount => null, // number of historical password that cannot be reused (type: integer, nullable)
	spamAndVirusConfiguration => null, // Spam and Antivirus configuration (type: email.exchange.spamAndVirusConfiguration)
));

print_r($result);
?>
```

## List DCV emails

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

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/general-information/#get-email-exchange-organizationname-service-exchangeservice-dcvemails

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

List DCV emails. Returns the email addresses that can receive the domain control validation email, when the SSL certificate expires within 30 days.

### 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 | string[] | successful operation |

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

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/email/exchange/{organizationName}/service/{exchangeService}/dcvEmails" \
  -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}/dcvEmails")

# 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}/dcvEmails");

print_r($result);
?>
```

## List active licenses

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

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/general-information/#get-email-exchange-organizationname-service-exchangeservice-license

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

List active licenses. Returns, for each day, the number of active accounts per license and the number of Outlook licenses. Filter by `fromDate`, `toDate` or `license`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `fromDate` | query | string (date) |  | Get active licenses since date |
| `license` | query | email.exchange.OvhLicenceEnum |  | License type — one of `basic`, `enterprise`, `standard` |
| `organizationName` | path | string | yes | The internal name of your exchange organization |
| `toDate` | query | string (date) |  | Get active licenses until date |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.exchange.DailyLicense[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `accountLicense` | email.exchange.AccountLicense[] |  |  |
| `accountLicense[].license` | email.exchange.OvhLicenceEnum |  | OVH licence account — one of `basic`, `enterprise`, `standard` |
| `accountLicense[].licenseQuantity` | integer |  |  |
| `date` | string (date) |  |  |
| `outlookQuantity` | integer |  |  |

```json
[
  {
    "accountLicense": [
      {
        "license": "basic",
        "licenseQuantity": 0
      }
    ],
    "date": "2024-01-01",
    "outlookQuantity": 0
  }
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/email/exchange/{organizationName}/service/{exchangeService}/license" \
  -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}/license")

# 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}/license");

print_r($result);
?>
```

## List available Outlook versions

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

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/general-information/#get-email-exchange-organizationname-service-exchangeservice-outlookavailability

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

List available Outlook versions. Returns whether each Outlook version and language is available. Filter by `outlookVersion` or `outlookLanguage`.

### 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 |
| `outlookLanguage` | query | email.exchange.LanguageEnum |  | Language version of outlook — one of `ar`, `bg`, `cz`, `da`, `de`, `el`, `en`, `es`, `et`, `fi`, `fr`, `he`, … |
| `outlookVersion` | query | email.exchange.OutlookVersionEnum |  | OS version of outlook — one of `mac_x86_2016`, `mac_x86_2019`, `mac_x86_2021`, `windows_x64_2016`, `windows_x64_2019`, `windows_x64_2021`, `windows_x86_2016`, `windows_x86_2019`, `windows_x86_2021` |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.exchange.OutlookVersions[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `outlookLanguage` | email.exchange.LanguageEnum |  | Outlook language — one of `ar`, `bg`, `cz`, `da`, `de`, `el`, `en`, `es`, `et`, `fi`, `fr`, `he`, … |
| `outlookVersion` | email.exchange.OutlookVersionEnum |  | Outlook version — one of `mac_x86_2016`, `mac_x86_2019`, `mac_x86_2021`, `windows_x64_2016`, `windows_x64_2019`, `windows_x64_2021`, `windows_x86_2016`, `windows_x86_2019`, `windows_x86_2021` |
| `status` | boolean |  |  |

```json
[
  {
    "outlookLanguage": "ar",
    "outlookVersion": "mac_x86_2016",
    "status": true
  }
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/email/exchange/{organizationName}/service/{exchangeService}/outlookAvailability" \
  -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}/outlookAvailability")

# 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}/outlookAvailability");

print_r($result);
?>
```

## Renew the SSL certificate

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

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/general-information/#post-email-exchange-organizationname-service-exchangeservice-renewssl

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

Renew the SSL certificate. Renews the SSL certificate when it expires within 30 days, and returns the task. Validate the domain with a DCV email (`dcv`) or a CNAME record (`useCname`), which `useDnsAssist` creates for a domain managed by OVHcloud.

### 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 |
| --- | --- | --- | --- |
| `dcv` | string |  | DCV email require for order ssl varification process, one of the options for ownership validation |
| `useCname` | boolean |  | Use CNAME for Domain Control Validation, one of the options for ownership validation |
| `useDnsAssist` | boolean |  | Set required CNAME record automatically if the domain is managed by OVH |

```json
{
  "dcv": "string",
  "useCname": true,
  "useDnsAssist": true
}
```

### 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}/renewSSL" \
  -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: boolean
result = client.post("/email/exchange/{organizationName}/service/{exchangeService}/renewSSL",
	dcv = None, # DCV email require for order ssl varification process, one of the options for ownership validation (type: string, nullable)
	useCname = None, # Use CNAME for Domain Control Validation, one of the options for ownership validation (type: boolean, nullable)
	useDnsAssist = None, # Set required CNAME record automatically if the domain is managed by OVH (type: boolean, nullable)
)

# 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: boolean
$result = $ovh->post("/email/exchange/{organizationName}/service/{exchangeService}/renewSSL", array(
	dcv => null, // DCV email require for order ssl varification process, one of the options for ownership validation (type: string, nullable)
	useCname => null, // Use CNAME for Domain Control Validation, one of the options for ownership validation (type: boolean, nullable)
	useDnsAssist => null, // Set required CNAME record automatically if the domain is managed by OVH (type: boolean, nullable)
));

print_r($result);
?>
```

## Get the server

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

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/general-information/#get-email-exchange-organizationname-service-exchangeservice-server

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

Get the server. Returns the Exchange version, state, IP addresses, disk usage, DNS record checks and Outlook Web Access MFA status of the server.

### 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.Server | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `commercialVersion` | email.exchange.exchangeCommercialVersionEnum | read-only | Exchange commercial version — one of `2010`, `2013`, `2016`, `2019`, `SE` |
| `currentDiskUsage` | integer | read-only | Current disk usage in MB |
| `diskSize` | integer | read-only | Total disk size in MB |
| `individual2010` | boolean | read-only | If true server is 2010 individual offer |
| `ip` | string | read-only | ipV4 |
| `ipV6` | string | read-only | ipV6 |
| `isAValid` | boolean | read-only | If true your dns A record is valid |
| `isAaaaValid` | boolean | read-only | If true your dns AAAA record is valid |
| `isPtrV6Valid` | boolean | read-only | If true your dns ptrV6 record is valid |
| `isPtrValid` | boolean | read-only | If true your dns ptr record is valid |
| `owaMfa` | boolean |  | Indicates if Multi Factor Authentication is activated on Outlook Web Access interface |
| `state` | email.exchange.ServerStateEnum | read-only | Server state — one of `configurationError`, `configurationPending`, `notConfigured`, `ok` |
| `taskPendingId` | integer | read-only | Task pending id |
| `version` | integer | read-only | ExchangeServer version |

```json
{
  "commercialVersion": "2010",
  "currentDiskUsage": 0,
  "diskSize": 0,
  "individual2010": true,
  "ip": "string",
  "ipV6": "string",
  "isAValid": true,
  "isAaaaValid": true,
  "isPtrV6Valid": true,
  "isPtrValid": true,
  "owaMfa": true,
  "state": "configurationError",
  "taskPendingId": 0,
  "version": 0
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/email/exchange/{organizationName}/service/{exchangeService}/server" \
  -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}/server")

# 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}/server");

print_r($result);
?>
```

## Update the server

`PUT /1.0/email/exchange/{organizationName}/service/{exchangeService}/server`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/general-information/#put-email-exchange-organizationname-service-exchangeservice-server

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

Update the server. Updates the server settings: set `owaMfa` to enable or disable MFA on the Outlook Web Access interface.

### 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: `email.exchange.Server`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `commercialVersion` | email.exchange.exchangeCommercialVersionEnum | read-only | Exchange commercial version — one of `2010`, `2013`, `2016`, `2019`, `SE` |
| `currentDiskUsage` | integer | read-only | Current disk usage in MB |
| `diskSize` | integer | read-only | Total disk size in MB |
| `individual2010` | boolean | read-only | If true server is 2010 individual offer |
| `ip` | string | read-only | ipV4 |
| `ipV6` | string | read-only | ipV6 |
| `isAValid` | boolean | read-only | If true your dns A record is valid |
| `isAaaaValid` | boolean | read-only | If true your dns AAAA record is valid |
| `isPtrV6Valid` | boolean | read-only | If true your dns ptrV6 record is valid |
| `isPtrValid` | boolean | read-only | If true your dns ptr record is valid |
| `owaMfa` | boolean |  | Indicates if Multi Factor Authentication is activated on Outlook Web Access interface |
| `state` | email.exchange.ServerStateEnum | read-only | Server state — one of `configurationError`, `configurationPending`, `notConfigured`, `ok` |
| `taskPendingId` | integer | read-only | Task pending id |
| `version` | integer | read-only | ExchangeServer version |

```json
{
  "owaMfa": true
}
```

### Responses

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

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/1.0/email/exchange/{organizationName}/service/{exchangeService}/server" \
  -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.Server
result = client.put("/email/exchange/{organizationName}/service/{exchangeService}/server",
	owaMfa = None, # Indicates if Multi Factor Authentication is activated on Outlook Web Access interface (type: boolean)
)

# 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.Server
$result = $ovh->put("/email/exchange/{organizationName}/service/{exchangeService}/server", array(
	owaMfa => null, // Indicates if Multi Factor Authentication is activated on Outlook Web Access interface (type: boolean)
));

print_r($result);
?>
```

## Get service information

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

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/general-information/#get-email-exchange-organizationname-service-exchangeservice-serviceinfos

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

Get service information. Returns the status, creation and expiration dates, contacts and renewal settings of the service.

### 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 | services.Service | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `canDeleteAtExpiration` | boolean | read-only | Indicates that the service can be set up to be deleted at expiration |
| `contactAdmin` | string | read-only |  |
| `contactBilling` | string | read-only |  |
| `contactTech` | string | read-only |  |
| `creation` | string (date) | read-only |  |
| `domain` | string | read-only |  |
| `engagedUpTo` | string (date) | read-only |  |
| `expiration` | string (date) | read-only |  |
| `possibleRenewPeriod` | integer[] | read-only | All the possible renew period of your service in month |
| `renew` | service.RenewType |  | Way of handling the renew |
| `renew.automatic` | boolean |  | The service is automatically renewed |
| `renew.deleteAtExpiration` | boolean |  | The service will be deleted at expiration |
| `renew.forced` | boolean |  | The service forced to be renewed |
| `renew.manualPayment` | boolean |  | The service needs to be manually renewed and paid |
| `renew.period` | integer |  | period of renew in month |
| `renewalType` | service.RenewalTypeEnum | read-only | Detailed renewal type of a service — one of `automaticForcedProduct`, `automaticV2012`, `automaticV2014`, `automaticV2016`, `automaticV2024`, `manual`, `oneShot`, `option` |
| `serviceId` | integer | read-only |  |
| `status` | service.StateEnum | read-only | one of `autorenewInProgress`, `expired`, `inCreation`, `ok`, `pendingDebt`, `unPaid` |

```json
{
  "canDeleteAtExpiration": true,
  "contactAdmin": "string",
  "contactBilling": "string",
  "contactTech": "string",
  "creation": "2024-01-01",
  "domain": "string",
  "engagedUpTo": "2024-01-01",
  "expiration": "2024-01-01",
  "possibleRenewPeriod": [
    0
  ],
  "renew": {
    "automatic": true,
    "deleteAtExpiration": true,
    "forced": true,
    "manualPayment": true,
    "period": 0
  },
  "renewalType": "automaticForcedProduct",
  "serviceId": 0,
  "status": "autorenewInProgress"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/email/exchange/{organizationName}/service/{exchangeService}/serviceInfos" \
  -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}/serviceInfos")

# 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}/serviceInfos");

print_r($result);
?>
```

## Update service information

`PUT /1.0/email/exchange/{organizationName}/service/{exchangeService}/serviceInfos`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/general-information/#put-email-exchange-organizationname-service-exchangeservice-serviceinfos

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

Update service information. Updates the renewal settings of the service: automatic renewal, period, or deletion at expiration.

### 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: `services.Service`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `canDeleteAtExpiration` | boolean | read-only | Indicates that the service can be set up to be deleted at expiration |
| `contactAdmin` | string | read-only |  |
| `contactBilling` | string | read-only |  |
| `contactTech` | string | read-only |  |
| `creation` | string (date) | read-only |  |
| `domain` | string | read-only |  |
| `engagedUpTo` | string (date) | read-only |  |
| `expiration` | string (date) | read-only |  |
| `possibleRenewPeriod` | integer[] | read-only | All the possible renew period of your service in month |
| `renew` | service.RenewType |  | Way of handling the renew |
| `renew.automatic` | boolean |  | The service is automatically renewed |
| `renew.deleteAtExpiration` | boolean |  | The service will be deleted at expiration |
| `renew.forced` | boolean |  | The service forced to be renewed |
| `renew.manualPayment` | boolean |  | The service needs to be manually renewed and paid |
| `renew.period` | integer |  | period of renew in month |
| `renewalType` | service.RenewalTypeEnum | read-only | Detailed renewal type of a service — one of `automaticForcedProduct`, `automaticV2012`, `automaticV2014`, `automaticV2016`, `automaticV2024`, `manual`, `oneShot`, `option` |
| `serviceId` | integer | read-only |  |
| `status` | service.StateEnum | read-only | one of `autorenewInProgress`, `expired`, `inCreation`, `ok`, `pendingDebt`, `unPaid` |

```json
{
  "renew": {
    "automatic": true,
    "deleteAtExpiration": true,
    "forced": true,
    "manualPayment": true,
    "period": 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}/serviceInfos" \
  -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: services.Service
result = client.put("/email/exchange/{organizationName}/service/{exchangeService}/serviceInfos",
	renew = None, # Way of handling the renew (type: service.RenewType, nullable)
)

# 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: services.Service
$result = $ovh->put("/email/exchange/{organizationName}/service/{exchangeService}/serviceInfos", array(
	renew => null, // Way of handling the renew (type: service.RenewType, nullable)
));

print_r($result);
?>
```

## List Active Directory services

`GET /1.0/msServices`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/general-information/#get-msservices

**Status:** Stable production version  
**IAM actions:** `microsoftServices:apiovh:get`

List Active Directory services. Returns the names of the Active Directory services of the account. Filter them by IAM tags with `iamTags`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `iamTags` | query | object |  | Filter resources on IAM tags |

### Responses

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

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

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/msServices" \
  -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("/msServices")

# 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("/msServices");

print_r($result);
?>
```

## Get an Active Directory service

`GET /1.0/msServices/{serviceName}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/general-information/#get-msservices-servicename

**Status:** Stable production version  
**IAM actions:** `microsoftServices:apiovh:get`

Get an Active Directory service. Returns the name, state and password policy of the Active Directory service, and the service name of the linked Microsoft 365 tenant.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The internal name of your Active Directory organization |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | msServices.ActiveDirectoryOrganizationalUnitWithIAM | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `complexityEnabled` | boolean |  | Flag indicating if passwords should be forced to follow Microsoft's password guidelines |
| `iam` | iam.ResourceMetadata | read-only | IAM resource metadata |
| `iam.displayName` | string | read-only | Resource display name |
| `iam.id` | string (uuid) | read-only | Unique identifier of the resource |
| `iam.state` | iam.ResourceMetadata.StateEnum | read-only | Resource state — one of `EXPIRED`, `IN_CREATION`, `OK`, `SUSPENDED` |
| `iam.tags` | object | read-only | Resource tags. Tags that were internally computed are prefixed with ovh: |
| `iam.urn` | string | read-only | Unique resource name used in policies |
| `lockoutDuration` | integer |  | Account lock time (in minutes) when too much passwords have been tried |
| `lockoutObservationWindow` | integer |  | Time (in minutes) before the password attempts counter is reset |
| `lockoutThreshold` | integer |  | Maximum number of password tries before account locking |
| `maxPasswordAge` | integer |  | Maximum lifespan of passwords, in days |
| `minPasswordAge` | integer |  | Minimum lifespan of passwords, in days (0 = unlimited) |
| `minPasswordLength` | integer |  | Minimum number of characters passwords must contain |
| `name` | string | read-only | Name of the Active Directory organizational unit |
| `officeTenantServiceName` | string | read-only | Service name of the office tenant (/licence/office/{serviceName}) linked to this AD service |
| `state` | msServices.ServiceStateEnum | read-only | Current state of the Active Directory organizational unit — one of `creating`, `deleting`, `inMaintenance`, `ok`, `reopening`, `suspended`, `suspending` |
| `taskPendingId` | integer | read-only | Task pending id |

```json
{
  "complexityEnabled": true,
  "iam": {
    "displayName": "string",
    "id": "00000000-0000-0000-0000-000000000000",
    "state": "EXPIRED",
    "tags": {
      "key": "string"
    },
    "urn": "string"
  },
  "lockoutDuration": 0,
  "lockoutObservationWindow": 0,
  "lockoutThreshold": 0,
  "maxPasswordAge": 0,
  "minPasswordAge": 0,
  "minPasswordLength": 0,
  "name": "string",
  "officeTenantServiceName": "string",
  "state": "creating",
  "taskPendingId": 0
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/msServices/{serviceName}" \
  -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("/msServices/{serviceName}")

# 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("/msServices/{serviceName}");

print_r($result);
?>
```

## Update an Active Directory service

`PUT /1.0/msServices/{serviceName}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/general-information/#put-msservices-servicename

**Status:** Stable production version  
**IAM actions:** `microsoftServices:apiovh:put`

Update an Active Directory service. Updates the password policy: complexity, minimum length, minimum and maximum age, and lockout threshold, duration and observation window.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The internal name of your Active Directory organization |

### Request body (required)

Type: `msServices.ActiveDirectoryOrganizationalUnit`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `complexityEnabled` | boolean |  | Flag indicating if passwords should be forced to follow Microsoft's password guidelines |
| `lockoutDuration` | integer |  | Account lock time (in minutes) when too much passwords have been tried |
| `lockoutObservationWindow` | integer |  | Time (in minutes) before the password attempts counter is reset |
| `lockoutThreshold` | integer |  | Maximum number of password tries before account locking |
| `maxPasswordAge` | integer |  | Maximum lifespan of passwords, in days |
| `minPasswordAge` | integer |  | Minimum lifespan of passwords, in days (0 = unlimited) |
| `minPasswordLength` | integer |  | Minimum number of characters passwords must contain |
| `name` | string | read-only | Name of the Active Directory organizational unit |
| `officeTenantServiceName` | string | read-only | Service name of the office tenant (/licence/office/{serviceName}) linked to this AD service |
| `state` | msServices.ServiceStateEnum | read-only | Current state of the Active Directory organizational unit — one of `creating`, `deleting`, `inMaintenance`, `ok`, `reopening`, `suspended`, `suspending` |
| `taskPendingId` | integer | read-only | Task pending id |

```json
{
  "complexityEnabled": true,
  "lockoutDuration": 0,
  "lockoutObservationWindow": 0,
  "lockoutThreshold": 0,
  "maxPasswordAge": 0,
  "minPasswordAge": 0,
  "minPasswordLength": 0
}
```

### Responses

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

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/1.0/msServices/{serviceName}" \
  -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: msServices.ActiveDirectoryOrganizationalUnit
result = client.put("/msServices/{serviceName}",
	complexityEnabled = None, # Flag indicating if passwords should be forced to follow Microsoft's password guidelines (type: boolean)
	lockoutDuration = None, # Account lock time (in minutes) when too much passwords have been tried (type: integer)
	lockoutObservationWindow = None, # Time (in minutes) before the password attempts counter is reset (type: integer)
	lockoutThreshold = None, # Maximum number of password tries before account locking (type: integer, nullable)
	maxPasswordAge = None, # Maximum lifespan of passwords, in days (type: integer, nullable)
	minPasswordAge = None, # Minimum lifespan of passwords, in days (0 = unlimited) (type: integer, nullable)
	minPasswordLength = None, # Minimum number of characters passwords must contain (type: integer, nullable)
)

# 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: msServices.ActiveDirectoryOrganizationalUnit
$result = $ovh->put("/msServices/{serviceName}", array(
	complexityEnabled => null, // Flag indicating if passwords should be forced to follow Microsoft's password guidelines (type: boolean)
	lockoutDuration => null, // Account lock time (in minutes) when too much passwords have been tried (type: integer)
	lockoutObservationWindow => null, // Time (in minutes) before the password attempts counter is reset (type: integer)
	lockoutThreshold => null, // Maximum number of password tries before account locking (type: integer, nullable)
	maxPasswordAge => null, // Maximum lifespan of passwords, in days (type: integer, nullable)
	minPasswordAge => null, // Minimum lifespan of passwords, in days (0 = unlimited) (type: integer, nullable)
	minPasswordLength => null, // Minimum number of characters passwords must contain (type: integer, nullable)
));

print_r($result);
?>
```

## Change service contacts

`POST /1.0/msServices/{serviceName}/changeContact`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/general-information/#post-msservices-servicename-changecontact

**Status:** Stable production version  
**IAM actions:** `microsoftServices:apiovh:changeContact`

Change service contacts. Starts a procedure to change the admin, tech or billing contact of the service.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The internal name of your Active Directory organization |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `contactAdmin` | string |  | The contact to set as admin contact |
| `contactBilling` | string |  | The contact to set as billing contact |
| `contactTech` | string |  | The contact to set as tech contact |

```json
{
  "contactAdmin": "string",
  "contactBilling": "string",
  "contactTech": "string"
}
```

### Responses

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

```json
[
  0
]
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/msServices/{serviceName}/changeContact" \
  -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: coreTypes.AccountId:string
result = client.post("/msServices/{serviceName}/changeContact",
	contactAdmin = None, # The contact to set as admin contact (type: coreTypes.AccountId:string, nullable)
	contactBilling = None, # The contact to set as billing contact (type: coreTypes.AccountId:string, nullable)
	contactTech = None, # The contact to set as tech contact (type: coreTypes.AccountId:string, nullable)
)

# 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: coreTypes.AccountId:string
$result = $ovh->post("/msServices/{serviceName}/changeContact", array(
	contactAdmin => null, // The contact to set as admin contact (type: coreTypes.AccountId:string, nullable)
	contactBilling => null, // The contact to set as billing contact (type: coreTypes.AccountId:string, nullable)
	contactTech => null, // The contact to set as tech contact (type: coreTypes.AccountId:string, nullable)
));

print_r($result);
?>
```

## Get the linked Exchange service

`GET /1.0/msServices/{serviceName}/exchange`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/general-information/#get-msservices-servicename-exchange

**Status:** Stable production version  
**IAM actions:** `microsoftServices:apiovh:exchange/get`

Get the linked Exchange service. Returns the Exchange service linked to the Active Directory service: offer, hostname, state, SSL certificate expiration date, message size limits and spam and antivirus configuration.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The internal name of your Active Directory organization |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | msServices.ExchangeService | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `displayName` | string |  | Service family name displayed |
| `domain` | string | read-only | Exchange service name |
| `hostname` | string | read-only | Exchange service URL |
| `maxReceiveSize` | integer |  | Maximum allowable size for received messages in MB |
| `maxSendSize` | integer |  | Maximum allowable size of sent messages in MB |
| `offer` | msServices.ServiceOfferEnum | read-only | Exchange service offer — one of `dedicated`, `dedicatedCluster`, `hosted`, `provider` |
| `spamAndVirusConfiguration` | msServices.SpamAndVirusConfiguration |  | Spam and Antivirus configuration |
| `spamAndVirusConfiguration.checkDKIM` | boolean |  | Check DKIM of message |
| `spamAndVirusConfiguration.checkSPF` | boolean |  | Check SPF of message |
| `spamAndVirusConfiguration.deleteSpam` | boolean |  | If message is a spam delete it |
| `spamAndVirusConfiguration.deleteVirus` | boolean |  | If message is a virus delete it |
| `spamAndVirusConfiguration.putInJunk` | boolean |  | If message is a spam or virus put in junk. Overridden by deleteSpam or deleteVirus |
| `spamAndVirusConfiguration.tagSpam` | boolean |  | If message is a spam change its subject |
| `spamAndVirusConfiguration.tagVirus` | boolean |  | If message is a virus change its subject |
| `sslExpirationDate` | string (date) | read-only | Expiration date of SSL certificate |
| `state` | msServices.ServiceStateEnum | read-only | Exchange service state — one of `creating`, `deleting`, `inMaintenance`, `ok`, `reopening`, `suspended`, `suspending` |
| `taskPendingId` | integer | read-only | Task pending id |

```json
{
  "displayName": "string",
  "domain": "string",
  "hostname": "string",
  "maxReceiveSize": 0,
  "maxSendSize": 0,
  "offer": "dedicated",
  "spamAndVirusConfiguration": {
    "checkDKIM": true,
    "checkSPF": true,
    "deleteSpam": true,
    "deleteVirus": true,
    "putInJunk": true,
    "tagSpam": true,
    "tagVirus": true
  },
  "sslExpirationDate": "2024-01-01",
  "state": "creating",
  "taskPendingId": 0
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/msServices/{serviceName}/exchange" \
  -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("/msServices/{serviceName}/exchange")

# 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("/msServices/{serviceName}/exchange");

print_r($result);
?>
```

## Update the linked Exchange service

`PUT /1.0/msServices/{serviceName}/exchange`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/general-information/#put-msservices-servicename-exchange

**Status:** Stable production version  
**IAM actions:** `microsoftServices:apiovh:exchange/edit`

Update the linked Exchange service. Updates the display name, the maximum sizes of sent and received messages in MB, and the spam and antivirus configuration of the Exchange service.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The internal name of your Active Directory organization |

### Request body (required)

Type: `msServices.ExchangeService`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `displayName` | string |  | Service family name displayed |
| `domain` | string | read-only | Exchange service name |
| `hostname` | string | read-only | Exchange service URL |
| `maxReceiveSize` | integer |  | Maximum allowable size for received messages in MB |
| `maxSendSize` | integer |  | Maximum allowable size of sent messages in MB |
| `offer` | msServices.ServiceOfferEnum | read-only | Exchange service offer — one of `dedicated`, `dedicatedCluster`, `hosted`, `provider` |
| `spamAndVirusConfiguration` | msServices.SpamAndVirusConfiguration |  | Spam and Antivirus configuration |
| `spamAndVirusConfiguration.checkDKIM` | boolean |  | Check DKIM of message |
| `spamAndVirusConfiguration.checkSPF` | boolean |  | Check SPF of message |
| `spamAndVirusConfiguration.deleteSpam` | boolean |  | If message is a spam delete it |
| `spamAndVirusConfiguration.deleteVirus` | boolean |  | If message is a virus delete it |
| `spamAndVirusConfiguration.putInJunk` | boolean |  | If message is a spam or virus put in junk. Overridden by deleteSpam or deleteVirus |
| `spamAndVirusConfiguration.tagSpam` | boolean |  | If message is a spam change its subject |
| `spamAndVirusConfiguration.tagVirus` | boolean |  | If message is a virus change its subject |
| `sslExpirationDate` | string (date) | read-only | Expiration date of SSL certificate |
| `state` | msServices.ServiceStateEnum | read-only | Exchange service state — one of `creating`, `deleting`, `inMaintenance`, `ok`, `reopening`, `suspended`, `suspending` |
| `taskPendingId` | integer | read-only | Task pending id |

```json
{
  "displayName": "string",
  "maxReceiveSize": 0,
  "maxSendSize": 0,
  "spamAndVirusConfiguration": {
    "checkDKIM": true,
    "checkSPF": true,
    "deleteSpam": true,
    "deleteVirus": true,
    "putInJunk": true,
    "tagSpam": true,
    "tagVirus": true
  }
}
```

### Responses

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

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/1.0/msServices/{serviceName}/exchange" \
  -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: msServices.ExchangeService
result = client.put("/msServices/{serviceName}/exchange",
	displayName = None, # Service family name displayed (type: string, nullable)
	maxReceiveSize = None, # Maximum allowable size for received messages in MB (type: integer)
	maxSendSize = None, # Maximum allowable size of sent messages in MB (type: integer)
	spamAndVirusConfiguration = None, # Spam and Antivirus configuration (type: msServices.SpamAndVirusConfiguration)
)

# 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: msServices.ExchangeService
$result = $ovh->put("/msServices/{serviceName}/exchange", array(
	displayName => null, // Service family name displayed (type: string, nullable)
	maxReceiveSize => null, // Maximum allowable size for received messages in MB (type: integer)
	maxSendSize => null, // Maximum allowable size of sent messages in MB (type: integer)
	spamAndVirusConfiguration => null, // Spam and Antivirus configuration (type: msServices.SpamAndVirusConfiguration)
));

print_r($result);
?>
```

## Check the billing migration

`GET /1.0/msServices/{serviceName}/exchange/billingMigrated`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/general-information/#get-msservices-servicename-exchange-billingmigrated

**Status:** Stable production version  
**IAM actions:** `microsoftServices:apiovh:exchange/billingMigrated/get`

Check the billing migration. Returns `true` when the service is billed by the new OVHcloud billing system.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The internal name of your Active Directory organization |

### Responses

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

```json
true
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/msServices/{serviceName}/exchange/billingMigrated" \
  -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("/msServices/{serviceName}/exchange/billingMigrated")

# 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("/msServices/{serviceName}/exchange/billingMigrated");

print_r($result);
?>
```
