# Web Cloud › SMS › Contacts API

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

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

Page: https://developers.eu.ovhcloud.com/reference/web-cloud/sms/contacts/

OpenAPI v1: https://api.eu.ovhcloud.com/1.0/__schemas/developer-hub-navigation/web-cloud/sms/contacts.json?format=openapi3
OpenAPI v2: https://api.eu.ovhcloud.com/v2/__schemas/developer-hub-navigation/web-cloud/sms/contacts.json?format=openapi3

## Operations

- `GET /sms/{serviceName}/phonebooks` — List phonebooks
- `GET /sms/{serviceName}/phonebooks/{bookKey}` — Get a phonebook
- `POST /sms/{serviceName}/phonebooks` — Create a phonebook
- `DELETE /sms/{serviceName}/phonebooks/{bookKey}` — Delete a phonebook
- `PUT /sms/{serviceName}/phonebooks/{bookKey}` — Update a phonebook
- `GET /sms/{serviceName}/phonebooks/{bookKey}/export` — Export contacts
- `POST /sms/{serviceName}/phonebooks/{bookKey}/import` — Import contacts
- `GET /sms/{serviceName}/phonebooks/{bookKey}/phonebookContact` — List contacts
- `GET /sms/{serviceName}/phonebooks/{bookKey}/phonebookContact/{id}` — Get a contact
- `POST /sms/{serviceName}/phonebooks/{bookKey}/phonebookContact` — Create a contact
- `DELETE /sms/{serviceName}/phonebooks/{bookKey}/phonebookContact/{id}` — Delete a contact
- `PUT /sms/{serviceName}/phonebooks/{bookKey}/phonebookContact/{id}` — Update a contact
- `GET /sms/{serviceName}/receivers` — List receiver lists
- `GET /sms/{serviceName}/receivers/{slotId}` — Get a receiver list
- `POST /sms/{serviceName}/receivers` — Create a receiver list
- `DELETE /sms/{serviceName}/receivers/{slotId}` — Delete a receiver list
- `PUT /sms/{serviceName}/receivers/{slotId}` — Update a receiver list
- `POST /sms/{serviceName}/receivers/{slotId}/clean` — Clean a receiver list
- `GET /sms/{serviceName}/receivers/{slotId}/csv` — Get the receiver list CSV

## List phonebooks

`GET /1.0/sms/{serviceName}/phonebooks`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/sms/contacts/#get-sms-servicename-phonebooks

**Status:** Stable production version  
**IAM actions:** `sms:apiovh:phonebooks/get`

List phonebooks. Returns the identifiers (bookKey) of the phonebooks of the SMS account. A phonebook stores contacts with their phone numbers.

### Parameters

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

### Responses

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

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

### Example

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

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

print_r($result);
?>
```

## Get a phonebook

`GET /1.0/sms/{serviceName}/phonebooks/{bookKey}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/sms/contacts/#get-sms-servicename-phonebooks-bookkey

**Status:** Stable production version  
**IAM actions:** `sms:apiovh:phonebooks/get`

Get a phonebook. Returns the name and the identifier (bookKey) of the phonebook. Its contacts are listed with the phonebookContact route.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `bookKey` | path | string | yes | Identifier of the phonebook |
| `serviceName` | path | string | yes | The internal name of your SMS offer |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | sms.Phonebook | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `bookKey` | string | read-only | Identifier of the phonebook |
| `name` | string |  | Phonebook name |
| `phoneKey` | string | read-only | Phone key identifier between the phone and phonebooks |

```json
{
  "bookKey": "string",
  "name": "string",
  "phoneKey": "string"
}
```

### Example

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

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

print_r($result);
?>
```

## Create a phonebook

`POST /1.0/sms/{serviceName}/phonebooks`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/sms/contacts/#post-sms-servicename-phonebooks

**Status:** Stable production version  
**IAM actions:** `sms:apiovh:phonebooks/create`

Create a phonebook. Creates a phonebook with a name. Returns its identifier (bookKey), used to add or import contacts.

### Parameters

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

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | yes | Name of the wanted phonebook |

```json
{
  "name": "string"
}
```

### Responses

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

```json
"string"
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/sms/{serviceName}/phonebooks" \
  -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("/sms/{serviceName}/phonebooks",
	name = None, # Name of the wanted phonebook (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("/sms/{serviceName}/phonebooks", array(
	name => null, // Name of the wanted phonebook (type: string)
));

print_r($result);
?>
```

## Delete a phonebook

`DELETE /1.0/sms/{serviceName}/phonebooks/{bookKey}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/sms/contacts/#delete-sms-servicename-phonebooks-bookkey

**Status:** Stable production version  
**IAM actions:** `sms:apiovh:phonebooks/delete`

Delete a phonebook. Deletes the phonebook and its contacts. Export the contacts first to keep a copy of them.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `bookKey` | path | string | yes | Identifier of the phonebook |
| `serviceName` | path | string | yes | The internal name of your SMS offer |

### Responses

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

### Example

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

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

print_r($result);
?>
```

## Update a phonebook

`PUT /1.0/sms/{serviceName}/phonebooks/{bookKey}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/sms/contacts/#put-sms-servicename-phonebooks-bookkey

**Status:** Stable production version  
**IAM actions:** `sms:apiovh:phonebooks/edit`

Update a phonebook. Updates the name of the phonebook. The contacts are updated one by one with the phonebookContact route.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `bookKey` | path | string | yes | Identifier of the phonebook |
| `serviceName` | path | string | yes | The internal name of your SMS offer |

### Request body (required)

Type: `sms.Phonebook`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `bookKey` | string | read-only | Identifier of the phonebook |
| `name` | string |  | Phonebook name |
| `phoneKey` | string | read-only | Phone key identifier between the phone and phonebooks |

```json
{
  "name": "string"
}
```

### Responses

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

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/1.0/sms/{serviceName}/phonebooks/{bookKey}" \
  -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: sms.Phonebook
result = client.put("/sms/{serviceName}/phonebooks/{bookKey}",
	name = None, # Phonebook name (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: sms.Phonebook
$result = $ovh->put("/sms/{serviceName}/phonebooks/{bookKey}", array(
	name => null, // Phonebook name (type: string)
));

print_r($result);
?>
```

## Export contacts

`GET /1.0/sms/{serviceName}/phonebooks/{bookKey}/export`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/sms/contacts/#get-sms-servicename-phonebooks-bookkey-export

**Status:** Stable production version  
**IAM actions:** `sms:apiovh:phonebooks/export/get`

Export contacts. Exports the contacts of the phonebook to a file in CSV format. Returns the file to download.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `bookKey` | path | string | yes | Identifier of the phonebook |
| `format` | query | telephony.ContactsExportFormatsEnum | yes | Format of the file — one of `csv` |
| `serviceName` | path | string | yes | The internal name of your SMS offer |

### Responses

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `filename` | string | read-only |  |
| `status` | telephony.PcsFileStatusEnum | read-only | File providing task status — one of `doing`, `done`, `error`, `todo` |
| `url` | string | read-only |  |
| `urlExpirationDatetime` | string (date-time) | read-only |  |

```json
{
  "filename": "string",
  "status": "doing",
  "url": "string",
  "urlExpirationDatetime": "2024-01-01T12:00:00Z"
}
```

### Example

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

# 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("/sms/{serviceName}/phonebooks/{bookKey}/export");

print_r($result);
?>
```

## Import contacts

`POST /1.0/sms/{serviceName}/phonebooks/{bookKey}/import`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/sms/contacts/#post-sms-servicename-phonebooks-bookkey-import

**Status:** Stable production version  
**IAM actions:** `sms:apiovh:phonebooks/import`

Import contacts. Imports contacts into the phonebook from an Excel (.xls, .xlsx) or CSV file in /me/document. Returns the task that performs the import.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `bookKey` | path | string | yes | Identifier of the phonebook |
| `serviceName` | path | string | yes | The internal name of your SMS offer |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `documentId` | string | yes | ID of the /me/document file you want to import |

```json
{
  "documentId": "string"
}
```

### 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 POST \
  "https://api.eu.ovhcloud.com/1.0/sms/{serviceName}/phonebooks/{bookKey}/import" \
  -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("/sms/{serviceName}/phonebooks/{bookKey}/import",
	documentId = None, # ID of the /me/document file you want to import (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("/sms/{serviceName}/phonebooks/{bookKey}/import", array(
	documentId => null, // ID of the /me/document file you want to import (type: string)
));

print_r($result);
?>
```

## List contacts

`GET /1.0/sms/{serviceName}/phonebooks/{bookKey}/phonebookContact`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/sms/contacts/#get-sms-servicename-phonebooks-bookkey-phonebookcontact

**Status:** Stable production version  
**IAM actions:** `sms:apiovh:phonebooks/phonebookContact/get`

List contacts. Returns the identifiers of the contacts of the phonebook. Get a contact for its name, group and phone numbers.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `bookKey` | path | string | yes | Identifier of the phonebook |
| `serviceName` | path | string | yes | The internal name of your SMS offer |

### Responses

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

```json
[
  0
]
```

### Example

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

# 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("/sms/{serviceName}/phonebooks/{bookKey}/phonebookContact");

print_r($result);
?>
```

## Get a contact

`GET /1.0/sms/{serviceName}/phonebooks/{bookKey}/phonebookContact/{id}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/sms/contacts/#get-sms-servicename-phonebooks-bookkey-phonebookcontact-id

**Status:** Stable production version  
**IAM actions:** `sms:apiovh:phonebooks/phonebookContact/get`

Get a contact. Returns the contact: name, surname, group, and office and home phone numbers, landline and mobile.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `bookKey` | path | string | yes | Identifier of the phonebook |
| `id` | path | integer | yes | Contact identifier |
| `serviceName` | path | string | yes | The internal name of your SMS offer |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | sms.PhonebookContact | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `group` | string |  | Group name of the phonebook |
| `homeMobile` | internationalPhoneNumber |  | Home mobile phone number of the contact |
| `homePhone` | internationalPhoneNumber |  | Home landline phone number of the contact |
| `id` | integer | read-only | Contact identifier |
| `name` | string |  | Contact name |
| `surname` | string |  | Contact surname |
| `workMobile` | internationalPhoneNumber |  | Mobile phone office number of the contact |
| `workPhone` | internationalPhoneNumber |  | Landline phone office number of the contact |

```json
{
  "group": "string",
  "homeMobile": "string",
  "homePhone": "string",
  "id": 0,
  "name": "string",
  "surname": "string",
  "workMobile": "string",
  "workPhone": "string"
}
```

### Example

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

# 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("/sms/{serviceName}/phonebooks/{bookKey}/phonebookContact/{id}");

print_r($result);
?>
```

## Create a contact

`POST /1.0/sms/{serviceName}/phonebooks/{bookKey}/phonebookContact`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/sms/contacts/#post-sms-servicename-phonebooks-bookkey-phonebookcontact

**Status:** Stable production version  
**IAM actions:** `sms:apiovh:phonebooks/phonebookContact/create`

Create a contact. Creates a contact in the phonebook with a name, surname, group and phone numbers. Returns its identifier.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `bookKey` | path | string | yes | Identifier of the phonebook |
| `serviceName` | path | string | yes | The internal name of your SMS offer |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `group` | string | yes | Group name of the phonebook |
| `homeMobile` | internationalPhoneNumber |  | Home mobile phone number of the contact |
| `homePhone` | internationalPhoneNumber |  | Home landline phone number of the contact |
| `name` | string | yes | Name of the contact |
| `surname` | string | yes | Contact surname |
| `workMobile` | internationalPhoneNumber |  | Mobile phone office number of the contact |
| `workPhone` | internationalPhoneNumber |  | Landline phone office number of the contact |

```json
{
  "group": "string",
  "homeMobile": "string",
  "homePhone": "string",
  "name": "string",
  "surname": "string",
  "workMobile": "string",
  "workPhone": "string"
}
```

### Responses

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

```json
0
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/sms/{serviceName}/phonebooks/{bookKey}/phonebookContact" \
  -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: internationalPhoneNumber
result = client.post("/sms/{serviceName}/phonebooks/{bookKey}/phonebookContact",
	group = None, # Group name of the phonebook (type: string)
	homeMobile = None, # Home mobile phone number of the contact (type: internationalPhoneNumber, nullable)
	homePhone = None, # Home landline phone number of the contact (type: internationalPhoneNumber, nullable)
	name = None, # Name of the contact (type: string)
	surname = None, # Contact surname (type: string)
	workMobile = None, # Mobile phone office number of the contact (type: internationalPhoneNumber, nullable)
	workPhone = None, # Landline phone office number of the contact (type: internationalPhoneNumber, nullable)
)

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

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

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

// Request body type: internationalPhoneNumber
$result = $ovh->post("/sms/{serviceName}/phonebooks/{bookKey}/phonebookContact", array(
	group => null, // Group name of the phonebook (type: string)
	homeMobile => null, // Home mobile phone number of the contact (type: internationalPhoneNumber, nullable)
	homePhone => null, // Home landline phone number of the contact (type: internationalPhoneNumber, nullable)
	name => null, // Name of the contact (type: string)
	surname => null, // Contact surname (type: string)
	workMobile => null, // Mobile phone office number of the contact (type: internationalPhoneNumber, nullable)
	workPhone => null, // Landline phone office number of the contact (type: internationalPhoneNumber, nullable)
));

print_r($result);
?>
```

## Delete a contact

`DELETE /1.0/sms/{serviceName}/phonebooks/{bookKey}/phonebookContact/{id}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/sms/contacts/#delete-sms-servicename-phonebooks-bookkey-phonebookcontact-id

**Status:** Stable production version  
**IAM actions:** `sms:apiovh:phonebooks/phonebookContact/delete`

Delete a contact. Deletes the contact from the phonebook, with its name, group and office and home phone numbers.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `bookKey` | path | string | yes | Identifier of the phonebook |
| `id` | path | integer | yes | Contact identifier |
| `serviceName` | path | string | yes | The internal name of your SMS offer |

### Responses

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

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/1.0/sms/{serviceName}/phonebooks/{bookKey}/phonebookContact/{id}" \
  -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("/sms/{serviceName}/phonebooks/{bookKey}/phonebookContact/{id}")

# 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("/sms/{serviceName}/phonebooks/{bookKey}/phonebookContact/{id}");

print_r($result);
?>
```

## Update a contact

`PUT /1.0/sms/{serviceName}/phonebooks/{bookKey}/phonebookContact/{id}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/sms/contacts/#put-sms-servicename-phonebooks-bookkey-phonebookcontact-id

**Status:** Stable production version  
**IAM actions:** `sms:apiovh:phonebooks/phonebookContact/edit`

Update a contact. Updates the contact: name, surname, group, and office and home phone numbers, landline and mobile.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `bookKey` | path | string | yes | Identifier of the phonebook |
| `id` | path | integer | yes | Contact identifier |
| `serviceName` | path | string | yes | The internal name of your SMS offer |

### Request body (required)

Type: `sms.PhonebookContact`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `group` | string |  | Group name of the phonebook |
| `homeMobile` | internationalPhoneNumber |  | Home mobile phone number of the contact |
| `homePhone` | internationalPhoneNumber |  | Home landline phone number of the contact |
| `id` | integer | read-only | Contact identifier |
| `name` | string |  | Contact name |
| `surname` | string |  | Contact surname |
| `workMobile` | internationalPhoneNumber |  | Mobile phone office number of the contact |
| `workPhone` | internationalPhoneNumber |  | Landline phone office number of the contact |

```json
{
  "group": "string",
  "homeMobile": "string",
  "homePhone": "string",
  "name": "string",
  "surname": "string",
  "workMobile": "string",
  "workPhone": "string"
}
```

### Responses

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

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/1.0/sms/{serviceName}/phonebooks/{bookKey}/phonebookContact/{id}" \
  -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: sms.PhonebookContact
result = client.put("/sms/{serviceName}/phonebooks/{bookKey}/phonebookContact/{id}",
	group = None, # Group name of the phonebook (type: string)
	homeMobile = None, # Home mobile phone number of the contact (type: internationalPhoneNumber, nullable)
	homePhone = None, # Home landline phone number of the contact (type: internationalPhoneNumber, nullable)
	name = None, # Contact name (type: string)
	surname = None, # Contact surname (type: string)
	workMobile = None, # Mobile phone office number of the contact (type: internationalPhoneNumber, nullable)
	workPhone = None, # Landline phone office number of the contact (type: internationalPhoneNumber, nullable)
)

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

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

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

// Request body type: sms.PhonebookContact
$result = $ovh->put("/sms/{serviceName}/phonebooks/{bookKey}/phonebookContact/{id}", array(
	group => null, // Group name of the phonebook (type: string)
	homeMobile => null, // Home mobile phone number of the contact (type: internationalPhoneNumber, nullable)
	homePhone => null, // Home landline phone number of the contact (type: internationalPhoneNumber, nullable)
	name => null, // Contact name (type: string)
	surname => null, // Contact surname (type: string)
	workMobile => null, // Mobile phone office number of the contact (type: internationalPhoneNumber, nullable)
	workPhone => null, // Landline phone office number of the contact (type: internationalPhoneNumber, nullable)
));

print_r($result);
?>
```

## List receiver lists

`GET /1.0/sms/{serviceName}/receivers`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/sms/contacts/#get-sms-servicename-receivers

**Status:** Stable production version  
**IAM actions:** `sms:apiovh:receivers/get`

List receiver lists. Returns the identifiers (slotId) of the receiver lists. A receiver list is a CSV or text document of numbers, used to send SMS in bulk.

### Parameters

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

### Responses

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

```json
[
  0
]
```

### Example

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

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

print_r($result);
?>
```

## Get a receiver list

`GET /1.0/sms/{serviceName}/receivers/{slotId}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/sms/contacts/#get-sms-servicename-receivers-slotid

**Status:** Stable production version  
**IAM actions:** `sms:apiovh:receivers/get`

Get a receiver list. Returns the receiver list: description, number of records and automatic update settings.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The internal name of your SMS offer |
| `slotId` | path | integer | yes | Slot number id |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | sms.Receiver | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `autoUpdate` | boolean |  | Download file from URL before sending to contacts (works only with csvUrl and not document ID) |
| `canAutoUpdate` | boolean | read-only | Is the object compatible with autoUpdate |
| `datetime` | string (date-time) | read-only | Creation date of the document |
| `description` | string |  | Description name of the document |
| `records` | integer | read-only | Number of receiver records in the document |
| `slotId` | integer | read-only | Slot number id |

```json
{
  "autoUpdate": true,
  "canAutoUpdate": true,
  "datetime": "2024-01-01T12:00:00Z",
  "description": "string",
  "records": 0,
  "slotId": 0
}
```

### Example

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

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

print_r($result);
?>
```

## Create a receiver list

`POST /1.0/sms/{serviceName}/receivers`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/sms/contacts/#post-sms-servicename-receivers

**Status:** Stable production version  
**IAM actions:** `sms:apiovh:receivers/create`

Create a receiver list. Creates a receiver list from a CSV file, given as a /me/document identifier or a URL. With a URL, the file can be downloaded again before each sending.

### Parameters

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

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `autoUpdate` | boolean | yes | Download file from URL before sending to contacts (works only with csvUrl and not document ID) |
| `csvUrl` | string |  | URL of the file you want to import |
| `description` | string | yes | Description name of the document |
| `documentId` | string |  | ID of the /me/document file you want to import |
| `slotId` | integer | yes | Slot number id used to handle the document |

```json
{
  "autoUpdate": true,
  "csvUrl": "string",
  "description": "string",
  "documentId": "string",
  "slotId": 0
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | sms.Receiver | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `autoUpdate` | boolean |  | Download file from URL before sending to contacts (works only with csvUrl and not document ID) |
| `canAutoUpdate` | boolean | read-only | Is the object compatible with autoUpdate |
| `datetime` | string (date-time) | read-only | Creation date of the document |
| `description` | string |  | Description name of the document |
| `records` | integer | read-only | Number of receiver records in the document |
| `slotId` | integer | read-only | Slot number id |

```json
{
  "autoUpdate": true,
  "canAutoUpdate": true,
  "datetime": "2024-01-01T12:00:00Z",
  "description": "string",
  "records": 0,
  "slotId": 0
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/sms/{serviceName}/receivers" \
  -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: long
result = client.post("/sms/{serviceName}/receivers",
	autoUpdate = None, # Download file from URL before sending to contacts (works only with csvUrl and not document ID) (type: boolean)
	csvUrl = None, # URL of the file you want to import (type: string, nullable)
	description = None, # Description name of the document (type: string)
	documentId = None, # ID of the /me/document file you want to import (type: string, nullable)
	slotId = None, # Slot number id used to handle the document (type: long)
)

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

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

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

// Request body type: long
$result = $ovh->post("/sms/{serviceName}/receivers", array(
	autoUpdate => null, // Download file from URL before sending to contacts (works only with csvUrl and not document ID) (type: boolean)
	csvUrl => null, // URL of the file you want to import (type: string, nullable)
	description => null, // Description name of the document (type: string)
	documentId => null, // ID of the /me/document file you want to import (type: string, nullable)
	slotId => null, // Slot number id used to handle the document (type: long)
));

print_r($result);
?>
```

## Delete a receiver list

`DELETE /1.0/sms/{serviceName}/receivers/{slotId}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/sms/contacts/#delete-sms-servicename-receivers-slotid

**Status:** Stable production version  
**IAM actions:** `sms:apiovh:receivers/delete`

Delete a receiver list. Deletes the receiver list. It can no longer be used as the receivers of an SMS sending (receiversSlotId).

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The internal name of your SMS offer |
| `slotId` | path | integer | yes | Slot number id |

### Responses

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

### Example

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

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

print_r($result);
?>
```

## Update a receiver list

`PUT /1.0/sms/{serviceName}/receivers/{slotId}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/sms/contacts/#put-sms-servicename-receivers-slotid

**Status:** Stable production version  
**IAM actions:** `sms:apiovh:receivers/edit`

Update a receiver list. Updates the description of the receiver list and its automatic update, which downloads the file from its URL before each sending.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The internal name of your SMS offer |
| `slotId` | path | integer | yes | Slot number id |

### Request body (required)

Type: `sms.Receiver`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `autoUpdate` | boolean |  | Download file from URL before sending to contacts (works only with csvUrl and not document ID) |
| `canAutoUpdate` | boolean | read-only | Is the object compatible with autoUpdate |
| `datetime` | string (date-time) | read-only | Creation date of the document |
| `description` | string |  | Description name of the document |
| `records` | integer | read-only | Number of receiver records in the document |
| `slotId` | integer | read-only | Slot number id |

```json
{
  "autoUpdate": true,
  "description": "string"
}
```

### Responses

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

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/1.0/sms/{serviceName}/receivers/{slotId}" \
  -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: sms.Receiver
result = client.put("/sms/{serviceName}/receivers/{slotId}",
	autoUpdate = None, # Download file from URL before sending to contacts (works only with csvUrl and not document ID) (type: boolean)
	description = None, # Description name of the document (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: sms.Receiver
$result = $ovh->put("/sms/{serviceName}/receivers/{slotId}", array(
	autoUpdate => null, // Download file from URL before sending to contacts (works only with csvUrl and not document ID) (type: boolean)
	description => null, // Description name of the document (type: string)
));

print_r($result);
?>
```

## Clean a receiver list

`POST /1.0/sms/{serviceName}/receivers/{slotId}/clean`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/sms/contacts/#post-sms-servicename-receivers-slotid-clean

**Status:** Stable production version  
**IAM actions:** `sms:apiovh:receivers/clean`

Clean a receiver list. Removes the invalid and inactive numbers from the receiver list, with an HLR lookup on each number. A report is sent by email at the end.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The internal name of your SMS offer |
| `slotId` | path | integer | yes | Slot number id |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `freemium` | boolean | yes | Limit checks to syntaxical validation |
| `priceOnly` | boolean | yes | Only get action's price in credits without executing it |

```json
{
  "freemium": true,
  "priceOnly": true
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | sms.ReceiversAsynchronousCleanReport | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `taskId` | integer |  |  |
| `totalCreditsRemoved` | number |  |  |

```json
{
  "taskId": 0,
  "totalCreditsRemoved": 0
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/sms/{serviceName}/receivers/{slotId}/clean" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

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

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

result = client.post("/sms/{serviceName}/receivers/{slotId}/clean",
	freemium = None, # Limit checks to syntaxical validation (type: boolean)
	priceOnly = None, # Only get action's price in credits without executing it (type: boolean)
)

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

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

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

$result = $ovh->post("/sms/{serviceName}/receivers/{slotId}/clean", array(
	freemium => null, // Limit checks to syntaxical validation (type: boolean)
	priceOnly => null, // Only get action's price in credits without executing it (type: boolean)
));

print_r($result);
?>
```

## Get the receiver list CSV

`GET /1.0/sms/{serviceName}/receivers/{slotId}/csv`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/sms/contacts/#get-sms-servicename-receivers-slotid-csv

**Status:** Stable production version  
**IAM actions:** `sms:apiovh:receivers/csv/get`

Get the receiver list CSV. Returns the content of the receiver list in CSV format. The number of records is given when getting the receiver list.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The internal name of your SMS offer |
| `slotId` | path | integer | yes | Slot number id |

### Responses

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

```json
"string"
```

### Example

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

# 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("/sms/{serviceName}/receivers/{slotId}/csv");

print_r($result);
?>
```
