# Web Cloud › Telephony › SIP Trunk › Subscription & Usage 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

> 28 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/telephony/sip-trunk/subscription-usage/

OpenAPI v1: https://api.eu.ovhcloud.com/1.0/__schemas/developer-hub-navigation/web-cloud/telephony/sip-trunk/subscription-usage.json?format=openapi3
OpenAPI v2: https://api.eu.ovhcloud.com/v2/__schemas/developer-hub-navigation/web-cloud/telephony/sip-trunk/subscription-usage.json?format=openapi3

## Operations

- `GET /telephony/{billingAccount}/service` — List services
- `GET /telephony/{billingAccount}/service/{serviceName}` — Get a service
- `DELETE /telephony/{billingAccount}/service/{serviceName}` — Terminate a service
- `PUT /telephony/{billingAccount}/service/{serviceName}` — Update a service
- `POST /telephony/{billingAccount}/service/{serviceName}/cancelTermination` — Cancel the service termination
- `POST /telephony/{billingAccount}/service/{serviceName}/changeOfBillingAccount` — Move a service to another billing account
- `GET /telephony/{billingAccount}/service/{serviceName}/diagnosticReports` — Get diagnostic reports
- `GET /telephony/{billingAccount}/service/{serviceName}/directory` — Get the directory listing
- `PUT /telephony/{billingAccount}/service/{serviceName}/directory` — Update the directory listing
- `POST /telephony/{billingAccount}/service/{serviceName}/directory/fetchEntrepriseInformations` — Fetch company information
- `GET /telephony/{billingAccount}/service/{serviceName}/directory/getDirectoryServiceCode` — Get the directory service code
- `GET /telephony/{billingAccount}/service/{serviceName}/directory/getWayTypes` — List street types
- `GET /telephony/{billingAccount}/service/{serviceName}/eventToken` — Get the event token
- `POST /telephony/{billingAccount}/service/{serviceName}/eventToken` — Create an event token
- `DELETE /telephony/{billingAccount}/service/{serviceName}/eventToken` — Delete the event token
- `GET /telephony/{billingAccount}/service/{serviceName}/offerChange` — Get the scheduled offer change
- `POST /telephony/{billingAccount}/service/{serviceName}/offerChange` — Schedule an offer change
- `DELETE /telephony/{billingAccount}/service/{serviceName}/offerChange` — Cancel the scheduled offer change
- `GET /telephony/{billingAccount}/service/{serviceName}/offerChanges` — List available offer changes
- `GET /telephony/{billingAccount}/service/{serviceName}/offerTask` — List offer tasks
- `GET /telephony/{billingAccount}/service/{serviceName}/offerTask/{taskId}` — Get an offer task
- `PUT /telephony/{billingAccount}/service/{serviceName}/offerTask/{taskId}` — Update an offer task
- `GET /telephony/{billingAccount}/service/{serviceName}/previousVoiceConsumption` — List last month call records
- `GET /telephony/{billingAccount}/service/{serviceName}/previousVoiceConsumption/{consumptionId}` — Get a last month call record
- `GET /telephony/{billingAccount}/service/{serviceName}/task` — List tasks
- `GET /telephony/{billingAccount}/service/{serviceName}/task/{taskId}` — Get a task
- `GET /telephony/{billingAccount}/service/{serviceName}/voiceConsumption` — List call records
- `GET /telephony/{billingAccount}/service/{serviceName}/voiceConsumption/{consumptionId}` — Get a call record

## List services

`GET /1.0/telephony/{billingAccount}/service`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/telephony/sip-trunk/subscription-usage/#get-telephony-billingaccount-service

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `billingAccount` | path | string | yes | The name of your billingAccount |

### Responses

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

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

### Example

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

print_r($result);
?>
```

## Get a service

`GET /1.0/telephony/{billingAccount}/service/{serviceName}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/telephony/sip-trunk/subscription-usage/#get-telephony-billingaccount-service-servicename

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `billingAccount` | path | string | yes | The name of your billingAccount |
| `serviceName` | path | string | yes |  |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | telephony.TelephonyService | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `associatedDeviceMac` | macAddress | read-only | MAC address of the associated device if there is one. |
| `country` | telephony.ServiceNumberCountryEnum | read-only | The country of the number — one of `be`, `ch`, `de`, `es`, `fr`, `gb`, `uk` |
| `countryCode` | telephony.NumberCountryCodeEnum | read-only | The country code of the number — one of `32`, `33`, `34`, `41`, `44`, `49` |
| `currentOutplan` | order.Price | read-only | Current outplan |
| `currentOutplan.currencyCode` | order.CurrencyCodeEnum |  | one of `AUD`, `CAD`, `CZK`, `EUR`, `GBP`, `INR`, `LTL`, `MAD`, `N/A`, `PLN`, `SGD`, `TND`, … |
| `currentOutplan.text` | string |  |  |
| `currentOutplan.value` | number |  |  |
| `description` | string |  |  |
| `featureType` | telephony.TypeEnum | read-only | All existing types of line or alias — one of `aiAgent`, `carrierSip`, `cloudHunting`, `cloudIvr`, `conference`, `contactCenterSolution`, `contactCenterSolutionExpert`, `ddi`, `easyHunting`, `empty`, `fax`, `freefax`, … |
| `getPublicOffer` | telephony.LineOffer | read-only | The service offers |
| `getPublicOffer.description` | string |  | The offer description |
| `getPublicOffer.name` | string |  | The offer name |
| `getPublicOffer.price` | order.Price |  | Offer price per month |
| `getPublicOffer.price.currencyCode` | order.CurrencyCodeEnum |  | one of `AUD`, `CAD`, `CZK`, `EUR`, `GBP`, `INR`, `LTL`, `MAD`, `N/A`, `PLN`, `SGD`, `TND`, … |
| `getPublicOffer.price.text` | string |  |  |
| `getPublicOffer.price.value` | number |  |  |
| `hasFaxCapabilities` | boolean | read-only | Does this service have fax capabilities? |
| `offers` | string[] | read-only |  |
| `properties` | telephony.PropertyEnum[] | read-only |  |
| `rio` | string | read-only | The identifier to use to port the number |
| `serviceName` | string | read-only |  |
| `serviceType` | telephony.TypeServiceEnum | read-only | All existing types — one of `alias`, `line` |
| `simultaneousLines` | integer | read-only |  |

```json
{
  "associatedDeviceMac": "00:00:5e:00:53:01",
  "country": "be",
  "countryCode": 32,
  "currentOutplan": {
    "currencyCode": "AUD",
    "text": "string",
    "value": 0
  },
  "description": "string",
  "featureType": "aiAgent",
  "getPublicOffer": {
    "description": "string",
    "name": "string",
    "price": {
      "currencyCode": "AUD",
      "text": "string",
      "value": 0
    }
  },
  "hasFaxCapabilities": true,
  "offers": [
    "string"
  ],
  "properties": [
    "xdsl"
  ],
  "rio": "string",
  "serviceName": "string",
  "serviceType": "alias",
  "simultaneousLines": 0
}
```

### Example

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

print_r($result);
?>
```

## Terminate a service

`DELETE /1.0/telephony/{billingAccount}/service/{serviceName}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/telephony/sip-trunk/subscription-usage/#delete-telephony-billingaccount-service-servicename

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `billingAccount` | path | string | yes | The name of your billingAccount |
| `details` | query | string |  | Termination reason details |
| `reason` | query | telephony.TerminationReasonEnum | yes | Termination reason — one of `addresseMove`, `billingDifficulties`, `cessationOfActivity`, `missingOptions`, `moveToCompetitor`, `other`, `plugAndPhoneDifficulties`, `technicalDifficulties` |
| `serviceName` | path | string | yes |  |

### Responses

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

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/1.0/telephony/{billingAccount}/service/{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.delete("/telephony/{billingAccount}/service/{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->delete("/telephony/{billingAccount}/service/{serviceName}");

print_r($result);
?>
```

## Update a service

`PUT /1.0/telephony/{billingAccount}/service/{serviceName}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/telephony/sip-trunk/subscription-usage/#put-telephony-billingaccount-service-servicename

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `billingAccount` | path | string | yes | The name of your billingAccount |
| `serviceName` | path | string | yes |  |

### Request body (required)

Type: `telephony.TelephonyService`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `associatedDeviceMac` | macAddress | read-only | MAC address of the associated device if there is one. |
| `country` | telephony.ServiceNumberCountryEnum | read-only | The country of the number — one of `be`, `ch`, `de`, `es`, `fr`, `gb`, `uk` |
| `countryCode` | telephony.NumberCountryCodeEnum | read-only | The country code of the number — one of `32`, `33`, `34`, `41`, `44`, `49` |
| `currentOutplan` | order.Price | read-only | Current outplan |
| `currentOutplan.currencyCode` | order.CurrencyCodeEnum |  | one of `AUD`, `CAD`, `CZK`, `EUR`, `GBP`, `INR`, `LTL`, `MAD`, `N/A`, `PLN`, `SGD`, `TND`, … |
| `currentOutplan.text` | string |  |  |
| `currentOutplan.value` | number |  |  |
| `description` | string |  |  |
| `featureType` | telephony.TypeEnum | read-only | All existing types of line or alias — one of `aiAgent`, `carrierSip`, `cloudHunting`, `cloudIvr`, `conference`, `contactCenterSolution`, `contactCenterSolutionExpert`, `ddi`, `easyHunting`, `empty`, `fax`, `freefax`, … |
| `getPublicOffer` | telephony.LineOffer | read-only | The service offers |
| `getPublicOffer.description` | string |  | The offer description |
| `getPublicOffer.name` | string |  | The offer name |
| `getPublicOffer.price` | order.Price |  | Offer price per month |
| `getPublicOffer.price.currencyCode` | order.CurrencyCodeEnum |  | one of `AUD`, `CAD`, `CZK`, `EUR`, `GBP`, `INR`, `LTL`, `MAD`, `N/A`, `PLN`, `SGD`, `TND`, … |
| `getPublicOffer.price.text` | string |  |  |
| `getPublicOffer.price.value` | number |  |  |
| `hasFaxCapabilities` | boolean | read-only | Does this service have fax capabilities? |
| `offers` | string[] | read-only |  |
| `properties` | telephony.PropertyEnum[] | read-only |  |
| `rio` | string | read-only | The identifier to use to port the number |
| `serviceName` | string | read-only |  |
| `serviceType` | telephony.TypeServiceEnum | read-only | All existing types — one of `alias`, `line` |
| `simultaneousLines` | integer | read-only |  |

```json
{
  "description": "string"
}
```

### Responses

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

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/1.0/telephony/{billingAccount}/service/{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: telephony.TelephonyService
result = client.put("/telephony/{billingAccount}/service/{serviceName}",
	description = None, #  (type: string)
)

# 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: telephony.TelephonyService
$result = $ovh->put("/telephony/{billingAccount}/service/{serviceName}", array(
	description => null, //  (type: string)
));

print_r($result);
?>
```

## Cancel the service termination

`POST /1.0/telephony/{billingAccount}/service/{serviceName}/cancelTermination`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/telephony/sip-trunk/subscription-usage/#post-telephony-billingaccount-service-servicename-canceltermination

**Status:** Stable production version  
**IAM actions:** `voip:apiovh:service/cancelTermination`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `billingAccount` | path | string | yes | The name of your billingAccount |
| `serviceName` | path | string | yes |  |

### Responses

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

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/telephony/{billingAccount}/service/{serviceName}/cancelTermination" \
  -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.post("/telephony/{billingAccount}/service/{serviceName}/cancelTermination")

# 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("/telephony/{billingAccount}/service/{serviceName}/cancelTermination");

print_r($result);
?>
```

## Move a service to another billing account

`POST /1.0/telephony/{billingAccount}/service/{serviceName}/changeOfBillingAccount`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/telephony/sip-trunk/subscription-usage/#post-telephony-billingaccount-service-servicename-changeofbillingaccount

**Status:** Stable production version  
**IAM actions:** `voip:apiovh:service/changeOfBillingAccount`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `billingAccount` | path | string | yes | The name of your billingAccount |
| `serviceName` | path | string | yes |  |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `billingAccountDestination` | string | yes | Billing account destination target |

```json
{
  "billingAccountDestination": "string"
}
```

### Responses

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

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/telephony/{billingAccount}/service/{serviceName}/changeOfBillingAccount" \
  -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: string
result = client.post("/telephony/{billingAccount}/service/{serviceName}/changeOfBillingAccount",
	billingAccountDestination = None, # Billing account destination target (type: string)
)

# 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: string
$result = $ovh->post("/telephony/{billingAccount}/service/{serviceName}/changeOfBillingAccount", array(
	billingAccountDestination => null, // Billing account destination target (type: string)
));

print_r($result);
?>
```

## Get diagnostic reports

`GET /1.0/telephony/{billingAccount}/service/{serviceName}/diagnosticReports`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/telephony/sip-trunk/subscription-usage/#get-telephony-billingaccount-service-servicename-diagnosticreports

**Status:** Deprecated, will be removed  
**Deprecated** since 2024-01-01, removed on 2024-02-01.  
**IAM actions:** `voip:apiovh:service/diagnosticReports/get`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `billingAccount` | path | string | yes | The name of your billingAccount |
| `dayInterval` | query | telephony.DiagnosticReportIndexEnum | yes | The date index interval — one of `2 days ago`, `3 days ago`, `today`, `yesterday` |
| `serviceName` | path | string | yes |  |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | telephony.DiagnosticReport[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `callId` | string |  | Identifier of the concerned leg |
| `category` | telephony.DiagnosticReportCategoryEnum |  | Typology where the diagnostic arriving from — one of `dpi`, `signal` |
| `datetime` | string (date-time) |  | Datetime of the diagnostic |
| `description` | string |  | Explanation of the diagnostic |
| `level` | telephony.DiagnosticReportLevelEnum |  | The level of the diagnostic — one of `debug`, `error`, `info`, `warn` |
| `name` | string |  | Name of the rule detected |
| `report` | string |  | Report of the diagnostic |

```json
[
  {
    "callId": "string",
    "category": "dpi",
    "datetime": "2024-01-01T12:00:00Z",
    "description": "string",
    "level": "debug",
    "name": "string",
    "report": "string"
  }
]
```

### Example

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

# 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("/telephony/{billingAccount}/service/{serviceName}/diagnosticReports");

print_r($result);
?>
```

## Get the directory listing

`GET /1.0/telephony/{billingAccount}/service/{serviceName}/directory`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/telephony/sip-trunk/subscription-usage/#get-telephony-billingaccount-service-servicename-directory

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `billingAccount` | path | string | yes | The name of your billingAccount |
| `serviceName` | path | string | yes |  |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | telephony.DirectoryInfo | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `address` | string |  |  |
| `addressExtra` | string |  |  |
| `ape` | string |  |  |
| `areaCode` | integer | read-only |  |
| `birthDate` | string (date) |  |  |
| `cedex` | string |  |  |
| `city` | string |  |  |
| `country` | string |  |  |
| `directoryServiceCode` | string |  |  |
| `displayFirstName` | boolean |  |  |
| `displayMarketingDirectory` | boolean |  |  |
| `displayOnlyCity` | boolean |  |  |
| `displaySearchReverse` | boolean |  |  |
| `displayUniversalDirectory` | boolean |  |  |
| `email` | string |  |  |
| `firstName` | string |  |  |
| `gender` | nichandle.GenderEnum |  | All genders a person can choose — one of `female`, `male` |
| `inseeCode` | integer | read-only |  |
| `legalForm` | string |  |  |
| `lineDescription` | string |  |  |
| `modificationDate` | string | read-only |  |
| `modificationType` | string | read-only |  |
| `name` | string |  |  |
| `number` | string | read-only |  |
| `occupation` | string |  |  |
| `postBox` | string |  |  |
| `postCode` | string |  |  |
| `siret` | string |  |  |
| `socialNomination` | string |  |  |
| `socialNominationExtra` | string |  |  |
| `status` | string | read-only |  |
| `urbanDistrict` | string |  |  |
| `wayName` | string |  |  |
| `wayNumber` | string |  |  |
| `wayNumberExtra` | string |  |  |
| `wayType` | string |  |  |

```json
{
  "address": "string",
  "addressExtra": "string",
  "ape": "string",
  "areaCode": 0,
  "birthDate": "2024-01-01",
  "cedex": "string",
  "city": "string",
  "country": "string",
  "directoryServiceCode": "string",
  "displayFirstName": true,
  "displayMarketingDirectory": true,
  "displayOnlyCity": true,
  "displaySearchReverse": true,
  "displayUniversalDirectory": true,
  "email": "string",
  "firstName": "string",
  "gender": "female",
  "inseeCode": 0,
  "legalForm": "string",
  "lineDescription": "string",
  "modificationDate": "string",
  "modificationType": "string",
  "name": "string",
  "number": "string",
  "occupation": "string",
  "postBox": "string",
  "postCode": "string",
  "siret": "string",
  "socialNomination": "string",
  "socialNominationExtra": "string",
  "status": "string",
  "urbanDistrict": "string",
  "wayName": "string",
  "wayNumber": "string",
  "wayNumberExtra": "string",
  "wayType": "string"
}
```

### Example

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

# 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("/telephony/{billingAccount}/service/{serviceName}/directory");

print_r($result);
?>
```

## Update the directory listing

`PUT /1.0/telephony/{billingAccount}/service/{serviceName}/directory`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/telephony/sip-trunk/subscription-usage/#put-telephony-billingaccount-service-servicename-directory

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `billingAccount` | path | string | yes | The name of your billingAccount |
| `serviceName` | path | string | yes |  |

### Request body (required)

Type: `telephony.DirectoryInfo`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `address` | string |  |  |
| `addressExtra` | string |  |  |
| `ape` | string |  |  |
| `areaCode` | integer | read-only |  |
| `birthDate` | string (date) |  |  |
| `cedex` | string |  |  |
| `city` | string |  |  |
| `country` | string |  |  |
| `directoryServiceCode` | string |  |  |
| `displayFirstName` | boolean |  |  |
| `displayMarketingDirectory` | boolean |  |  |
| `displayOnlyCity` | boolean |  |  |
| `displaySearchReverse` | boolean |  |  |
| `displayUniversalDirectory` | boolean |  |  |
| `email` | string |  |  |
| `firstName` | string |  |  |
| `gender` | nichandle.GenderEnum |  | All genders a person can choose — one of `female`, `male` |
| `inseeCode` | integer | read-only |  |
| `legalForm` | string |  |  |
| `lineDescription` | string |  |  |
| `modificationDate` | string | read-only |  |
| `modificationType` | string | read-only |  |
| `name` | string |  |  |
| `number` | string | read-only |  |
| `occupation` | string |  |  |
| `postBox` | string |  |  |
| `postCode` | string |  |  |
| `siret` | string |  |  |
| `socialNomination` | string |  |  |
| `socialNominationExtra` | string |  |  |
| `status` | string | read-only |  |
| `urbanDistrict` | string |  |  |
| `wayName` | string |  |  |
| `wayNumber` | string |  |  |
| `wayNumberExtra` | string |  |  |
| `wayType` | string |  |  |

```json
{
  "address": "string",
  "addressExtra": "string",
  "ape": "string",
  "birthDate": "2024-01-01",
  "cedex": "string",
  "city": "string",
  "country": "string",
  "directoryServiceCode": "string",
  "displayFirstName": true,
  "displayMarketingDirectory": true,
  "displayOnlyCity": true,
  "displaySearchReverse": true,
  "displayUniversalDirectory": true,
  "email": "string",
  "firstName": "string",
  "gender": "female",
  "legalForm": "string",
  "lineDescription": "string",
  "name": "string",
  "occupation": "string",
  "postBox": "string",
  "postCode": "string",
  "siret": "string",
  "socialNomination": "string",
  "socialNominationExtra": "string",
  "urbanDistrict": "string",
  "wayName": "string",
  "wayNumber": "string",
  "wayNumberExtra": "string",
  "wayType": "string"
}
```

### Responses

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

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/1.0/telephony/{billingAccount}/service/{serviceName}/directory" \
  -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: telephony.DirectoryInfo
result = client.put("/telephony/{billingAccount}/service/{serviceName}/directory",
	address = None, #  (type: string)
	addressExtra = None, #  (type: string)
	ape = None, #  (type: string)
	birthDate = None, #  (type: string, nullable)
	cedex = None, #  (type: string)
	city = None, #  (type: string)
	country = None, #  (type: string)
	directoryServiceCode = None, #  (type: string)
	displayFirstName = None, #  (type: boolean)
	displayMarketingDirectory = None, #  (type: boolean)
	displayOnlyCity = None, #  (type: boolean)
	displaySearchReverse = None, #  (type: boolean)
	displayUniversalDirectory = None, #  (type: boolean)
	email = None, #  (type: string)
	firstName = None, #  (type: string)
	gender = None, #  (type: nichandle.GenderEnum, nullable)
	legalForm = None, #  (type: string)
	lineDescription = None, #  (type: string)
	name = None, #  (type: string)
	occupation = None, #  (type: string)
	postBox = None, #  (type: string)
	postCode = None, #  (type: string)
	siret = None, #  (type: string)
	socialNomination = None, #  (type: string)
	socialNominationExtra = None, #  (type: string)
	urbanDistrict = None, #  (type: string)
	wayName = None, #  (type: string)
	wayNumber = None, #  (type: string)
	wayNumberExtra = None, #  (type: string)
	wayType = None, #  (type: string)
)

# 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: telephony.DirectoryInfo
$result = $ovh->put("/telephony/{billingAccount}/service/{serviceName}/directory", array(
	address => null, //  (type: string)
	addressExtra => null, //  (type: string)
	ape => null, //  (type: string)
	birthDate => null, //  (type: string, nullable)
	cedex => null, //  (type: string)
	city => null, //  (type: string)
	country => null, //  (type: string)
	directoryServiceCode => null, //  (type: string)
	displayFirstName => null, //  (type: boolean)
	displayMarketingDirectory => null, //  (type: boolean)
	displayOnlyCity => null, //  (type: boolean)
	displaySearchReverse => null, //  (type: boolean)
	displayUniversalDirectory => null, //  (type: boolean)
	email => null, //  (type: string)
	firstName => null, //  (type: string)
	gender => null, //  (type: nichandle.GenderEnum, nullable)
	legalForm => null, //  (type: string)
	lineDescription => null, //  (type: string)
	name => null, //  (type: string)
	occupation => null, //  (type: string)
	postBox => null, //  (type: string)
	postCode => null, //  (type: string)
	siret => null, //  (type: string)
	socialNomination => null, //  (type: string)
	socialNominationExtra => null, //  (type: string)
	urbanDistrict => null, //  (type: string)
	wayName => null, //  (type: string)
	wayNumber => null, //  (type: string)
	wayNumberExtra => null, //  (type: string)
	wayType => null, //  (type: string)
));

print_r($result);
?>
```

## Fetch company information

`POST /1.0/telephony/{billingAccount}/service/{serviceName}/directory/fetchEntrepriseInformations`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/telephony/sip-trunk/subscription-usage/#post-telephony-billingaccount-service-servicename-directory-fetchentrepriseinformations

**Status:** Stable production version  
**IAM actions:** `voip:apiovh:service/directory/fetchEntrepriseInformations`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `billingAccount` | path | string | yes | The name of your billingAccount |
| `serviceName` | path | string | yes |  |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `entrepriseNumber` | string | yes | Entreprise number to fetch informations from |

```json
{
  "entrepriseNumber": "string"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | telephony.EntrepriseNumberInformationsTask | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `informations` | telephony.EntrepriseNumberInformations |  | Informations about the enterprise |
| `informations.address` | string |  | Address of the entreprise |
| `informations.ape` | string |  | Entreprise's category code for directory services |
| `informations.brand` | string |  | Brand of the entreprise |
| `informations.entrepriseNumber` | string |  | Entreprise number |
| `informations.isValid` | boolean |  | Is this a valid entreprise number? |
| `informations.name` | string |  | Name of the entreprise |
| `informations.siren` | string |  | Short version of the entreprise number (FR only) |
| `status` | telephony.TaskStatusEnum |  | Task status — one of `doing`, `done`, `error`, `pause`, `todo` |

```json
{
  "informations": {
    "address": "string",
    "ape": "string",
    "brand": "string",
    "entrepriseNumber": "string",
    "isValid": true,
    "name": "string",
    "siren": "string"
  },
  "status": "doing"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/telephony/{billingAccount}/service/{serviceName}/directory/fetchEntrepriseInformations" \
  -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: string
result = client.post("/telephony/{billingAccount}/service/{serviceName}/directory/fetchEntrepriseInformations",
	entrepriseNumber = None, # Entreprise number to fetch informations from (type: string)
)

# 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: string
$result = $ovh->post("/telephony/{billingAccount}/service/{serviceName}/directory/fetchEntrepriseInformations", array(
	entrepriseNumber => null, // Entreprise number to fetch informations from (type: string)
));

print_r($result);
?>
```

## Get the directory service code

`GET /1.0/telephony/{billingAccount}/service/{serviceName}/directory/getDirectoryServiceCode`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/telephony/sip-trunk/subscription-usage/#get-telephony-billingaccount-service-servicename-directory-getdirectoryservicecode

**Status:** Stable production version  
**IAM actions:** `voip:apiovh:service/directory/getDirectoryServiceCode/get`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `apeCode` | query | string | yes |  |
| `billingAccount` | path | string | yes | The name of your billingAccount |
| `serviceName` | path | string | yes |  |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | telephony.DirectoryHeadingPJ[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `apeCode` | string | read-only |  |
| `apeDescription` | string | read-only |  |
| `directoryServiceCode` | integer | read-only |  |
| `directoryServiceDescription` | string | read-only |  |
| `notification` | string | read-only |  |

```json
[
  {
    "apeCode": "string",
    "apeDescription": "string",
    "directoryServiceCode": 0,
    "directoryServiceDescription": "string",
    "notification": "string"
  }
]
```

### Example

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

# 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("/telephony/{billingAccount}/service/{serviceName}/directory/getDirectoryServiceCode");

print_r($result);
?>
```

## List street types

`GET /1.0/telephony/{billingAccount}/service/{serviceName}/directory/getWayTypes`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/telephony/sip-trunk/subscription-usage/#get-telephony-billingaccount-service-servicename-directory-getwaytypes

**Status:** Stable production version  
**IAM actions:** `voip:apiovh:service/directory/getWayTypes/get`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `billingAccount` | path | string | yes | The name of your billingAccount |
| `serviceName` | path | string | yes |  |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | telephony.DirectoryWayType[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `abbreviatedName` | string | read-only |  |
| `wayName` | string | read-only |  |

```json
[
  {
    "abbreviatedName": "string",
    "wayName": "string"
  }
]
```

### Example

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

# 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("/telephony/{billingAccount}/service/{serviceName}/directory/getWayTypes");

print_r($result);
?>
```

## Get the event token

`GET /1.0/telephony/{billingAccount}/service/{serviceName}/eventToken`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/telephony/sip-trunk/subscription-usage/#get-telephony-billingaccount-service-servicename-eventtoken

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `billingAccount` | path | string | yes | The name of your billingAccount |
| `serviceName` | path | string | yes |  |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | telephony.EventToken | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `token` | string | read-only |  |

```json
{
  "token": "string"
}
```

### Example

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

# 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("/telephony/{billingAccount}/service/{serviceName}/eventToken");

print_r($result);
?>
```

## Create an event token

`POST /1.0/telephony/{billingAccount}/service/{serviceName}/eventToken`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/telephony/sip-trunk/subscription-usage/#post-telephony-billingaccount-service-servicename-eventtoken

**Status:** Stable production version  
**IAM actions:** `voip:apiovh:service/eventToken/create`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `billingAccount` | path | string | yes | The name of your billingAccount |
| `serviceName` | path | string | yes |  |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `expiration` | telephony.TokenExpirationEnum | yes | Time to live in seconds for the token — one of `1 day`, `1 hour`, `30 days`, `5 minutes`, `unlimited` |

```json
{
  "expiration": "1 day"
}
```

### Responses

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

```json
"string"
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/telephony/{billingAccount}/service/{serviceName}/eventToken" \
  -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: telephony.TokenExpirationEnum
result = client.post("/telephony/{billingAccount}/service/{serviceName}/eventToken",
	expiration = None, # Time to live in seconds for the token (type: telephony.TokenExpirationEnum)
)

# 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: telephony.TokenExpirationEnum
$result = $ovh->post("/telephony/{billingAccount}/service/{serviceName}/eventToken", array(
	expiration => null, // Time to live in seconds for the token (type: telephony.TokenExpirationEnum)
));

print_r($result);
?>
```

## Delete the event token

`DELETE /1.0/telephony/{billingAccount}/service/{serviceName}/eventToken`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/telephony/sip-trunk/subscription-usage/#delete-telephony-billingaccount-service-servicename-eventtoken

**Status:** Stable production version  
**IAM actions:** `voip:apiovh:service/eventToken/delete`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `billingAccount` | path | string | yes | The name of your billingAccount |
| `serviceName` | path | string | yes |  |

### Responses

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

### Example

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

# 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("/telephony/{billingAccount}/service/{serviceName}/eventToken");

print_r($result);
?>
```

## Get the scheduled offer change

`GET /1.0/telephony/{billingAccount}/service/{serviceName}/offerChange`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/telephony/sip-trunk/subscription-usage/#get-telephony-billingaccount-service-servicename-offerchange

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `billingAccount` | path | string | yes | The name of your billingAccount |
| `serviceName` | path | string | yes |  |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | telephony.OfferChange | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `offer` | string | read-only | The current offer will be replace by this one on the next renew. |

```json
{
  "offer": "string"
}
```

### Example

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

# 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("/telephony/{billingAccount}/service/{serviceName}/offerChange");

print_r($result);
?>
```

## Schedule an offer change

`POST /1.0/telephony/{billingAccount}/service/{serviceName}/offerChange`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/telephony/sip-trunk/subscription-usage/#post-telephony-billingaccount-service-servicename-offerchange

**Status:** Stable production version  
**IAM actions:** `voip:apiovh:service/offerChange/create`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `billingAccount` | path | string | yes | The name of your billingAccount |
| `serviceName` | path | string | yes |  |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `offer` | string | yes | The future offer |

```json
{
  "offer": "string"
}
```

### Responses

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

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/telephony/{billingAccount}/service/{serviceName}/offerChange" \
  -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: string
result = client.post("/telephony/{billingAccount}/service/{serviceName}/offerChange",
	offer = None, # The future offer (type: string)
)

# 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: string
$result = $ovh->post("/telephony/{billingAccount}/service/{serviceName}/offerChange", array(
	offer => null, // The future offer (type: string)
));

print_r($result);
?>
```

## Cancel the scheduled offer change

`DELETE /1.0/telephony/{billingAccount}/service/{serviceName}/offerChange`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/telephony/sip-trunk/subscription-usage/#delete-telephony-billingaccount-service-servicename-offerchange

**Status:** Stable production version  
**IAM actions:** `voip:apiovh:service/offerChange/delete`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `billingAccount` | path | string | yes | The name of your billingAccount |
| `serviceName` | path | string | yes |  |

### Responses

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

### Example

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

# 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("/telephony/{billingAccount}/service/{serviceName}/offerChange");

print_r($result);
?>
```

## List available offer changes

`GET /1.0/telephony/{billingAccount}/service/{serviceName}/offerChanges`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/telephony/sip-trunk/subscription-usage/#get-telephony-billingaccount-service-servicename-offerchanges

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `billingAccount` | path | string | yes | The name of your billingAccount |
| `serviceName` | path | string | yes |  |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | telephony.LineOffer[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `description` | string |  | The offer description |
| `name` | string |  | The offer name |
| `price` | order.Price |  | Offer price per month |
| `price.currencyCode` | order.CurrencyCodeEnum |  | one of `AUD`, `CAD`, `CZK`, `EUR`, `GBP`, `INR`, `LTL`, `MAD`, `N/A`, `PLN`, `SGD`, `TND`, … |
| `price.text` | string |  |  |
| `price.value` | number |  |  |

```json
[
  {
    "description": "string",
    "name": "string",
    "price": {
      "currencyCode": "AUD",
      "text": "string",
      "value": 0
    }
  }
]
```

### Example

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

# 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("/telephony/{billingAccount}/service/{serviceName}/offerChanges");

print_r($result);
?>
```

## List offer tasks

`GET /1.0/telephony/{billingAccount}/service/{serviceName}/offerTask`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/telephony/sip-trunk/subscription-usage/#get-telephony-billingaccount-service-servicename-offertask

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `action` | query | telephony.OfferTaskActionEnum |  | Filter the value of action property (=) — one of `convertToAlias`, `convertToSip`, `migrateToNewVoicemail`, `removeSimltaneousLines`, `switchServer`, `termination`, `updateFirmware`, `upgrade` |
| `billingAccount` | path | string | yes | The name of your billingAccount |
| `serviceName` | path | string | yes |  |
| `status` | query | telephony.TaskStatusEnum |  | Filter the value of status property (=) — one of `doing`, `done`, `error`, `pause`, `todo` |
| `type` | query | telephony.OfferTaskTypeEnum |  | Filter the value of type property (=) — one of `line`, `offer`, `option`, `phone` |

### Responses

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

```json
[
  0
]
```

### Example

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

# 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("/telephony/{billingAccount}/service/{serviceName}/offerTask");

print_r($result);
?>
```

## Get an offer task

`GET /1.0/telephony/{billingAccount}/service/{serviceName}/offerTask/{taskId}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/telephony/sip-trunk/subscription-usage/#get-telephony-billingaccount-service-servicename-offertask-taskid

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `billingAccount` | path | string | yes | The name of your billingAccount |
| `serviceName` | path | string | yes |  |
| `taskId` | path | integer | yes |  |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | telephony.OfferTask | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `action` | telephony.OfferTaskActionEnum | read-only | Actual action that will be executed — one of `convertToAlias`, `convertToSip`, `migrateToNewVoicemail`, `removeSimltaneousLines`, `switchServer`, `termination`, `updateFirmware`, `upgrade` |
| `executionDate` | string (date-time) |  | Planned execution date |
| `status` | telephony.TaskStatusEnum | read-only | Current status of the task — one of `doing`, `done`, `error`, `pause`, `todo` |
| `taskId` | integer | read-only |  |
| `type` | telephony.OfferTaskTypeEnum | read-only | Type of operation that will be executed — one of `line`, `offer`, `option`, `phone` |

```json
{
  "action": "convertToAlias",
  "executionDate": "2024-01-01T12:00:00Z",
  "status": "doing",
  "taskId": 0,
  "type": "line"
}
```

### Example

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

# 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("/telephony/{billingAccount}/service/{serviceName}/offerTask/{taskId}");

print_r($result);
?>
```

## Update an offer task

`PUT /1.0/telephony/{billingAccount}/service/{serviceName}/offerTask/{taskId}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/telephony/sip-trunk/subscription-usage/#put-telephony-billingaccount-service-servicename-offertask-taskid

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `billingAccount` | path | string | yes | The name of your billingAccount |
| `serviceName` | path | string | yes |  |
| `taskId` | path | integer | yes |  |

### Request body (required)

Type: `telephony.OfferTask`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `action` | telephony.OfferTaskActionEnum | read-only | Actual action that will be executed — one of `convertToAlias`, `convertToSip`, `migrateToNewVoicemail`, `removeSimltaneousLines`, `switchServer`, `termination`, `updateFirmware`, `upgrade` |
| `executionDate` | string (date-time) |  | Planned execution date |
| `status` | telephony.TaskStatusEnum | read-only | Current status of the task — one of `doing`, `done`, `error`, `pause`, `todo` |
| `taskId` | integer | read-only |  |
| `type` | telephony.OfferTaskTypeEnum | read-only | Type of operation that will be executed — one of `line`, `offer`, `option`, `phone` |

```json
{
  "executionDate": "2024-01-01T12:00:00Z"
}
```

### Responses

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

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/1.0/telephony/{billingAccount}/service/{serviceName}/offerTask/{taskId}" \
  -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: telephony.OfferTask
result = client.put("/telephony/{billingAccount}/service/{serviceName}/offerTask/{taskId}",
	executionDate = None, # Planned execution date (type: string)
)

# 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: telephony.OfferTask
$result = $ovh->put("/telephony/{billingAccount}/service/{serviceName}/offerTask/{taskId}", array(
	executionDate => null, // Planned execution date (type: string)
));

print_r($result);
?>
```

## List last month call records

`GET /1.0/telephony/{billingAccount}/service/{serviceName}/previousVoiceConsumption`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/telephony/sip-trunk/subscription-usage/#get-telephony-billingaccount-service-servicename-previousvoiceconsumption

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `billingAccount` | path | string | yes | The name of your billingAccount |
| `creationDatetime.from` | query | string (date-time) |  | Filter the value of creationDatetime property (>=) |
| `creationDatetime.to` | query | string (date-time) |  | Filter the value of creationDatetime property (<=) |
| `destinationType` | query | telephony.VoiceConsumptionDestinationTypeEnum |  | Filter the value of destinationType property (=) — one of `landline`, `mobile`, `special` |
| `planType` | query | telephony.VoiceConsumptionPlanTypeEnum |  | Filter the value of planType property (=) — one of `outplan`, `priceplan` |
| `serviceName` | path | string | yes |  |
| `wayType` | query | telephony.VoiceConsumptionWayTypeEnum |  | Filter the value of wayType property (=) — one of `incoming`, `outgoing`, `transfer` |

### Responses

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

```json
[
  0
]
```

### Example

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

# 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("/telephony/{billingAccount}/service/{serviceName}/previousVoiceConsumption");

print_r($result);
?>
```

## Get a last month call record

`GET /1.0/telephony/{billingAccount}/service/{serviceName}/previousVoiceConsumption/{consumptionId}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/telephony/sip-trunk/subscription-usage/#get-telephony-billingaccount-service-servicename-previousvoiceconsumption-consumptionid

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `billingAccount` | path | string | yes | The name of your billingAccount |
| `consumptionId` | path | integer | yes |  |
| `serviceName` | path | string | yes |  |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | telephony.PreviousVoiceConsumption | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `called` | phoneNumber | read-only | Phone number |
| `calling` | phoneNumber | read-only | Phone number |
| `consumptionId` | integer | read-only |  |
| `countrySuffix` | string | read-only | Country suffix destination |
| `creationDatetime` | string (date-time) | read-only |  |
| `designation` | string | read-only | Description of the destination |
| `destinationType` | telephony.VoiceConsumptionDestinationTypeEnum | read-only | Consumption destination type — one of `landline`, `mobile`, `special` |
| `duration` | integer | read-only |  |
| `hangupNature` | string | read-only | Information about hangup cause |
| `planType` | telephony.VoiceConsumptionPlanTypeEnum | read-only | Consumption plan type — one of `outplan`, `priceplan` |
| `priceWithoutTax` | order.Price | read-only | Price with it's currency and textual representation |
| `priceWithoutTax.currencyCode` | order.CurrencyCodeEnum |  | one of `AUD`, `CAD`, `CZK`, `EUR`, `GBP`, `INR`, `LTL`, `MAD`, `N/A`, `PLN`, `SGD`, `TND`, … |
| `priceWithoutTax.text` | string |  |  |
| `priceWithoutTax.value` | number |  |  |
| `wayType` | telephony.VoiceConsumptionWayTypeEnum | read-only | Consumption way type — one of `incoming`, `outgoing`, `transfer` |

```json
{
  "called": "string",
  "calling": "string",
  "consumptionId": 0,
  "countrySuffix": "string",
  "creationDatetime": "2024-01-01T12:00:00Z",
  "designation": "string",
  "destinationType": "landline",
  "duration": 0,
  "hangupNature": "string",
  "planType": "outplan",
  "priceWithoutTax": {
    "currencyCode": "AUD",
    "text": "string",
    "value": 0
  },
  "wayType": "incoming"
}
```

### Example

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

# 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("/telephony/{billingAccount}/service/{serviceName}/previousVoiceConsumption/{consumptionId}");

print_r($result);
?>
```

## List tasks

`GET /1.0/telephony/{billingAccount}/service/{serviceName}/task`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/telephony/sip-trunk/subscription-usage/#get-telephony-billingaccount-service-servicename-task

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `action` | query | string |  | Filter the value of action property (=) |
| `billingAccount` | path | string | yes | The name of your billingAccount |
| `serviceName` | path | string | yes |  |
| `serviceType` | query | string |  | Filter the value of serviceType property (=) |
| `status` | query | telephony.TaskStatusEnum |  | Filter the value of status property (=) — one of `doing`, `done`, `error`, `pause`, `todo` |

### Responses

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

```json
[
  0
]
```

### Example

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

# 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("/telephony/{billingAccount}/service/{serviceName}/task");

print_r($result);
?>
```

## Get a task

`GET /1.0/telephony/{billingAccount}/service/{serviceName}/task/{taskId}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/telephony/sip-trunk/subscription-usage/#get-telephony-billingaccount-service-servicename-task-taskid

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `billingAccount` | path | string | yes | The name of your billingAccount |
| `serviceName` | path | string | yes |  |
| `taskId` | path | integer | yes |  |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | telephony.Task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `action` | string | read-only | Action associated with the task |
| `message` | string | read-only | Potential failure reason of the task |
| `objectCreated` | string | read-only | Object potentially created at the end of the task |
| `serviceType` | string | read-only |  |
| `status` | telephony.TaskStatusEnum | read-only | Status of the task — one of `doing`, `done`, `error`, `pause`, `todo` |
| `taskId` | integer | read-only |  |

```json
{
  "action": "string",
  "message": "string",
  "objectCreated": "string",
  "serviceType": "string",
  "status": "doing",
  "taskId": 0
}
```

### Example

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

# 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("/telephony/{billingAccount}/service/{serviceName}/task/{taskId}");

print_r($result);
?>
```

## List call records

`GET /1.0/telephony/{billingAccount}/service/{serviceName}/voiceConsumption`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/telephony/sip-trunk/subscription-usage/#get-telephony-billingaccount-service-servicename-voiceconsumption

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `billingAccount` | path | string | yes | The name of your billingAccount |
| `creationDatetime.from` | query | string (date-time) |  | Filter the value of creationDatetime property (>=) |
| `creationDatetime.to` | query | string (date-time) |  | Filter the value of creationDatetime property (<=) |
| `destinationType` | query | telephony.VoiceConsumptionDestinationTypeEnum |  | Filter the value of destinationType property (=) — one of `landline`, `mobile`, `special` |
| `planType` | query | telephony.VoiceConsumptionPlanTypeEnum |  | Filter the value of planType property (=) — one of `outplan`, `priceplan` |
| `serviceName` | path | string | yes |  |
| `wayType` | query | telephony.VoiceConsumptionWayTypeEnum |  | Filter the value of wayType property (=) — one of `incoming`, `outgoing`, `transfer` |

### Responses

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

```json
[
  0
]
```

### Example

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

# 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("/telephony/{billingAccount}/service/{serviceName}/voiceConsumption");

print_r($result);
?>
```

## Get a call record

`GET /1.0/telephony/{billingAccount}/service/{serviceName}/voiceConsumption/{consumptionId}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/telephony/sip-trunk/subscription-usage/#get-telephony-billingaccount-service-servicename-voiceconsumption-consumptionid

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `billingAccount` | path | string | yes | The name of your billingAccount |
| `consumptionId` | path | integer | yes |  |
| `serviceName` | path | string | yes |  |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | telephony.VoiceConsumption | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `called` | phoneNumber | read-only | Phone number |
| `calling` | phoneNumber | read-only | Phone number |
| `consumptionId` | integer | read-only |  |
| `countrySuffix` | string | read-only | Country suffix destination |
| `creationDatetime` | string (date-time) | read-only |  |
| `designation` | string | read-only | Description of the destination |
| `destinationType` | telephony.VoiceConsumptionDestinationTypeEnum | read-only | Consumption destination type — one of `landline`, `mobile`, `special` |
| `dialed` | phoneNumber | read-only | Phone number |
| `duration` | integer | read-only |  |
| `hangupNature` | string | read-only | Information about hangup cause |
| `planType` | telephony.VoiceConsumptionPlanTypeEnum | read-only | Consumption plan type — one of `outplan`, `priceplan` |
| `priceWithoutTax` | order.Price | read-only | Price with it's currency and textual representation |
| `priceWithoutTax.currencyCode` | order.CurrencyCodeEnum |  | one of `AUD`, `CAD`, `CZK`, `EUR`, `GBP`, `INR`, `LTL`, `MAD`, `N/A`, `PLN`, `SGD`, `TND`, … |
| `priceWithoutTax.text` | string |  |  |
| `priceWithoutTax.value` | number |  |  |
| `wayType` | telephony.VoiceConsumptionWayTypeEnum | read-only | Consumption way type — one of `incoming`, `outgoing`, `transfer` |

```json
{
  "called": "string",
  "calling": "string",
  "consumptionId": 0,
  "countrySuffix": "string",
  "creationDatetime": "2024-01-01T12:00:00Z",
  "designation": "string",
  "destinationType": "landline",
  "dialed": "string",
  "duration": 0,
  "hangupNature": "string",
  "planType": "outplan",
  "priceWithoutTax": {
    "currencyCode": "AUD",
    "text": "string",
    "value": 0
  },
  "wayType": "incoming"
}
```

### Example

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

# 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("/telephony/{billingAccount}/service/{serviceName}/voiceConsumption/{consumptionId}");

print_r($result);
?>
```
