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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: vonage_numbers-1.0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 e6ed05d05c0a86d5c4746d3fc69518439822b5f8519c4eda2e130cda79313264
MD5 5d677ab246ffc45fc9bb38d56437b81b
BLAKE2b-256 df04f99ac5ddc182fc356de48b141488cd1c0ec07cf8f469dd38a4ec748045ab

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for vonage_numbers-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f36fc7574a138f605a29801f8664391a0f11893f3c79d9d55d8dea3859c0176d
MD5 dac1eff85c36decedb44a1fd0821a144
BLAKE2b-256 f3d97e6eb41c026aadb97c5401d2b140ab4ac34f56cc89b104f69f98a5e6b917

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