# Web Cloud › SMS › Options 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

> 7 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/options/

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

## Operations

- `GET /sms/{serviceName}/blacklists` — List blacklisted numbers
- `GET /sms/{serviceName}/blacklists/{number}` — Get a blacklisted number
- `DELETE /sms/{serviceName}/blacklists/{number}` — Delete a blacklisted number
- `GET /sms/{serviceName}/smpp/allowedIPs` — List SMPP allowed IPs
- `PUT /sms/{serviceName}/smpp/allowedIPs` — Add or remove SMPP allowed IPs
- `POST /sms/{serviceName}/smpp/password` — Renew the SMPP password
- `GET /sms/{serviceName}/smpp/settings` — Get the SMPP settings

## List blacklisted numbers

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

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

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

List blacklisted numbers. Returns the numbers that replied STOP and no longer receive SMS from the account.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `batchID` | query | string (uuid) |  | Filter the value of batchID property (=) |
| `serviceName` | path | string | yes | The internal name of your SMS offer |
| `smsOutgoingID` | query | integer |  | Filter the value of smsOutgoingID property (=) |

### Responses

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

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

### Example

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

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

print_r($result);
?>
```

## Get a blacklisted number

`GET /1.0/sms/{serviceName}/blacklists/{number}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/sms/options/#get-sms-servicename-blacklists-number

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

Get a blacklisted number. Returns a blacklisted number, the date it was added, and the sent SMS or batch whose STOP reply added it.

### Parameters

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

### Responses

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `batchID` | string (uuid) | read-only | ID of the batch responsible of the blacklist |
| `dateCreation` | string (date-time) | read-only |  |
| `number` | string | read-only | The sms number blacklisted |
| `smsOutgoingID` | integer | read-only | ID of the outgoing SMS responsible of the blacklist |

```json
{
  "batchID": "00000000-0000-0000-0000-000000000000",
  "dateCreation": "2024-01-01T12:00:00Z",
  "number": "string",
  "smsOutgoingID": 0
}
```

### Example

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

# 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}/blacklists/{number}");

print_r($result);
?>
```

## Delete a blacklisted number

`DELETE /1.0/sms/{serviceName}/blacklists/{number}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/sms/options/#delete-sms-servicename-blacklists-number

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

Delete a blacklisted number. Removes the number from the blacklist of the account, so it can receive SMS from the account again.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `number` | path | string | yes | The sms number blacklisted |
| `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}/blacklists/{number}" \
  -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}/blacklists/{number}")

# 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}/blacklists/{number}");

print_r($result);
?>
```

## List SMPP allowed IPs

`GET /1.0/sms/{serviceName}/smpp/allowedIPs`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/sms/options/#get-sms-servicename-smpp-allowedips

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

Returns the IP addresses allowed to connect to the SMPP account.

### Parameters

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

### Responses

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

```json
[
  "192.0.2.0"
]
```

### Example

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

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

print_r($result);
?>
```

## Add or remove SMPP allowed IPs

`PUT /1.0/sms/{serviceName}/smpp/allowedIPs`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/sms/options/#put-sms-servicename-smpp-allowedips

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

Adds or removes IP addresses allowed to connect to the SMPP account, depending on the action.

### Parameters

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

### Request body (required)

Type: `sms.AllowedIPs`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `action` | sms.AllowedIPsActionEnum | yes | Action to perform on the provided IPs — one of `add`, `remove` |
| `ips` | ip[] | yes | List of IPs to add or remove |

```json
{
  "action": "add",
  "ips": [
    "192.0.2.0"
  ]
}
```

### Responses

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

```json
[
  "192.0.2.0"
]
```

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/1.0/sms/{serviceName}/smpp/allowedIPs" \
  -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.AllowedIPs
result = client.put("/sms/{serviceName}/smpp/allowedIPs",
	action = None, # Action to perform on the provided IPs (type: sms.AllowedIPsActionEnum)
	ips = None, # List of IPs to add or remove (type: array)
)

# 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.AllowedIPs
$result = $ovh->put("/sms/{serviceName}/smpp/allowedIPs", array(
	action => null, // Action to perform on the provided IPs (type: sms.AllowedIPsActionEnum)
	ips => null, // List of IPs to add or remove (type: array)
));

print_r($result);
?>
```

## Renew the SMPP password

`POST /1.0/sms/{serviceName}/smpp/password`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/sms/options/#post-sms-servicename-smpp-password

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

Generates a new password for the SMPP account.

### Parameters

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

### Responses

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

### Example

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

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

print_r($result);
?>
```

## Get the SMPP settings

`GET /1.0/sms/{serviceName}/smpp/settings`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/sms/options/#get-sms-servicename-smpp-settings

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

Returns the SMPP settings: TLS and non-TLS endpoints, system ID, status, throughput and windowing.

### Parameters

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

### Responses

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `endpoints` | sms.SettingsEndpoints[] | read-only | Addresses of the TLS and non-TLS endpoints |
| `endpoints[].secured` | string | read-only | address of the TLS endpoint: domain:port |
| `endpoints[].unsecured` | string | read-only | address of the non-TLS endpoint: domain:port |
| `status` | sms.SettingsStatusEnum | read-only | Status of the SMPP account — one of `DELETED`, `ERROR`, `SUCCESS`, `UNKNOWN`, `UPDATING_IP`, `WAITING_IP` |
| `systemID` | string | read-only | Username used to connect to OVHcloud SMSC |
| `throughput` | integer | read-only | Number of messages allowed per seconds |
| `windowing` | integer | read-only | Number of messages treated simultaneously |

```json
{
  "endpoints": [
    {
      "secured": "string",
      "unsecured": "string"
    }
  ],
  "status": "DELETED",
  "systemID": "string",
  "throughput": 0,
  "windowing": 0
}
```

### Example

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

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

print_r($result);
?>
```
