Skip to main content

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.2.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

vonage_numbers-1.0.2-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file vonage_numbers-1.0.2.tar.gz.

File metadata

  • Download URL: vonage_numbers-1.0.2.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.4

File hashes

Hashes for vonage_numbers-1.0.2.tar.gz
Algorithm Hash digest
SHA256 733cd4ce7831570be0548735cc77661beae20982ea8a7de7d7a80aaf343b9537
MD5 01593ea6a9982f3de5a60e10ce4f37a1
BLAKE2b-256 d112bae8d082b249b0370f61ccc5871dbab8a5294d8986330a00f1dc51c91896

See more details on using hashes here.

File details

Details for the file vonage_numbers-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for vonage_numbers-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6a9cdf9b7b2ea6787d36a9baddefdf78db12cf34fae82b39846db6b89748c4b1
MD5 5da9bb39f9a951c972e3486a8d2a98e4
BLAKE2b-256 27ba028325806459a8fb6eefcfe5676b329cda0d53e0d43c4ef646a39d6e9612

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page