Vonage Numbers package
Project description
Vonage Numbers Package
This package contains the code to use Vonage's Numbers API in Python.
It includes methods for managing and buying numbers.
Usage
It is recommended to use this as part of the main vonage
package. The examples below assume you've created an instance of the vonage.Vonage
class called vonage_client
.
List Numbers You Own
numbers, count, next_page = vonage_client.numbers.list_owned_numbers()
print(numbers)
print(count)
print(next_page)
# With filtering
from vonage_numbers import ListOwnedNumbersFilter
numbers, count, next_page = vonage_client.numbers.list_owned_numbers(
ListOwnedNumbersFilter(country='GB', size=3, index=2)
)
numbers, count, next_page_index = vonage_client.numbers.list_owned_numbers()
print(numbers)
print(count)
print(next_page_index)
Search for Available Numbers
from vonage_numbers import SearchAvailableNumbersFilter
numbers, count, next_page_index = vonage_client.numbers.search_available_numbers(
SearchAvailableNumbersFilter(
country='GB', size=10, pattern='44701', search_pattern=1
)
)
print(numbers)
print(count)
print(next_page_index)
Buy a Number
from vonage_numbers import NumberParams
status = vonage_client.numbers.buy_number(NumberParams(country='GB', msisdn='447007000000'))
print(status)
Cancel a number
from vonage_numbers import NumberParams
status = vonage_client.numbers.cancel_number(NumberParams(country='GB', msisdn='447007000000'))
print(status)
Update a Number
from vonage_numbers import UpdateNumberParams
status = vonage_client.numbers.update_number(
UpdateNumberParams(
country='GB',
msisdn='447007000000',
mo_http_url='https://example.com',
mo_smpp_sytem_type='inbound',
voice_callback_type='tel',
voice_callback_value='447008000000',
voice_status_callback='https://example.com',
)
)
print(status)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
vonage_numbers-1.0.0.tar.gz
(5.3 kB
view details)
Built Distribution
File details
Details for the file vonage_numbers-1.0.0.tar.gz
.
File metadata
- Download URL: vonage_numbers-1.0.0.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea63d7fb137c11d9c058e3418ffaa2c32770e07276beb493ba40f713c163c2db |
|
MD5 | 98beec1bb0508b4b7743ca0fc6023d5c |
|
BLAKE2b-256 | bcd9b70ba9c3be575d9b5def1dd93f6e1fa5f7fcd62a481de35e1e2002e920cc |
File details
Details for the file vonage_numbers-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: vonage_numbers-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e11fe0cbde86085ac566a44d845816932d890811ec0897f9effee202755ee402 |
|
MD5 | 55981350e58a4a9ebccf69ef2483c4bc |
|
BLAKE2b-256 | 650a4aa8e46796a618cdc3a786b9899e112a0b63f87b3fef6edaa9c6949bf457 |