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
Built Distribution
File details
Details for the file vonage_account-1.0.2.tar.gz
.
File metadata
- Download URL: vonage_account-1.0.2.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92bffd097f2963b331b53e5601bc48190096a52d82d6d01d093680370d8d9698 |
|
MD5 | 7075f9c29265b5ed7af7875405727d1a |
|
BLAKE2b-256 | 9c3d1be9f7f99dcafa375f1cbad8ac99f2dfb01dbe6d667d86ac68c69033afa3 |
File details
Details for the file vonage_account-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: vonage_account-1.0.2-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63059ed06d61c26a1d1d3de846afc14473638de137f5bd55b455291499f27af0 |
|
MD5 | 3ca78db630c2ad6e53fc18165d1fa35a |
|
BLAKE2b-256 | d65f2a0ad38638cd4bc3d92a946e1ff3477a22890b938fbc49926c6c07a05f25 |