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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: vonage_numbers-1.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 51b7d5ae75540e21d7ccd8090b4c4ab57a275929e6153b9813a7900f24a7aae5
MD5 5ec48bf29f301b53a56c28b5ce3edcd0
BLAKE2b-256 11da278df4530c76bcb5ab69c8458ea95cb1e1489fb474bc8d2fcafadfa67c3f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for vonage_numbers-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ba81fb8898bc59eb0fbfd9b347331202b21bd18839d7e8f344f92f7c7ec98ca5
MD5 fbc1b04b6feb99228a5346854c6942fb
BLAKE2b-256 554cd4059647c1c5b87bc753a12558cd253765bf77ec2f1cbd5c300da75d2ab0

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