Skip to main content

Vonage Account API package

Project description

Vonage Account Package

This package contains the code to use Vonage's Account API in Python.

It includes methods for managing Vonage accounts.

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.

Get Account Balance

balance = vonage_client.account.get_balance()
print(balance)

Top-Up Account

response = vonage_client.account.top_up(trx='1234567890')
print(response)

Update the Default SMS Webhook

This will return a Pydantic object (SettingsResponse) containing multiple settings for your account.

settings: SettingsResponse = vonage_client.account.update_default_sms_webhook(
    mo_callback_url='https://example.com/inbound_sms_webhook',
    dr_callback_url='https://example.com/delivery_receipt_webhook',
)

print(settings)

List Secrets Associated with the Account

response = vonage_client.account.list_secrets()
print(response)

Create a New Account Secret

secret = vonage_client.account.create_secret('Mytestsecret12345')
print(secret)

Get Information About One Secret

secret = vonage_client.account.get_secret(MY_SECRET_ID)
print(secret)

Revoke a Secret

Note: it isn't possible to revoke all account secrets, there must always be one valid secret. Attempting to do so will give a 403 error.

client.account.revoke_secret(MY_SECRET_ID)

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_account-1.0.0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

vonage_account-1.0.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file vonage_account-1.0.0.tar.gz.

File metadata

  • Download URL: vonage_account-1.0.0.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for vonage_account-1.0.0.tar.gz
Algorithm Hash digest
SHA256 788e12fdd206f28bf4c7d71fffaa56780640c2598e2bfc28267df64653d42ddf
MD5 d14e85963e907fdd91c7019753cc7512
BLAKE2b-256 f60b81a3d42d7e31d67c3a7d3a865a60cae8128b7031338bf28fe5ff3f62ea30

See more details on using hashes here.

File details

Details for the file vonage_account-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for vonage_account-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9794c4bed6545ec5443a55754f9d9352b6d7ea8342fda27b16d52987cc26d709
MD5 38770c07f60eec5f8a6b06a4b8868a8b
BLAKE2b-256 072fa8070934b9a707ca212827e31c1d65717359475205d9039fa1c2757b7c3a

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