Skip to main content

Vonage Application API package

Project description

Vonage Application API Package

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

It includes methods for managing applications.

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 Applications

With no custom options specified, this method will get the first 100 applications. It returns a tuple consisting of a list of ApplicationData objects and an int showing the page number of the next page of results.

from vonage_application import ListApplicationsFilter, ApplicationData

applications, next_page = vonage_client.application.list_applications()

# With options
options = ListApplicationsFilter(page_size=3, page=2)
applications, next_page = vonage_client.application.list_applications(options)

Create a New Application

from vonage_application import ApplicationConfig

app_data = vonage_client.application.create_application()

# Create with custom options (can also be done with a dict)
from vonage_application import ApplicationConfig, Keys, Voice, VoiceWebhooks
voice = Voice(
    webhooks=VoiceWebhooks(
        event_url=VoiceUrl(
            address='https://example.com/event',
            http_method='POST',
            connect_timeout=500,
            socket_timeout=3000,
        ),
    ),
    signed_callbacks=True,
)
capabilities = Capabilities(voice=voice)
keys = Keys(public_key='MY_PUBLIC_KEY')
config = ApplicationConfig(
    name='My Customised Application',
    capabilities=capabilities,
    keys=keys,
)
app_data = vonage_client.application.create_application(config)

Get an Application

app_data = client.application.get_application('MY_APP_ID')
app_data_as_dict = app.model_dump(exclude_none=True)

Update an Application

To update an application, pass config for the updated field(s) in an ApplicationConfig object

from vonage_application import ApplicationConfig, Keys, Voice, VoiceWebhooks

config = ApplicationConfig(name='My Updated Application')
app_data = vonage_client.application.update_application('MY_APP_ID', config)

Delete an Application

vonage_client.applications.delete_application('MY_APP_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_application-2.0.0.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

vonage_application-2.0.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file vonage_application-2.0.0.tar.gz.

File metadata

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

File hashes

Hashes for vonage_application-2.0.0.tar.gz
Algorithm Hash digest
SHA256 642d281ddaedb2873ba38f41f715c4fc0592232ef669d92f8636ac312ab6051a
MD5 30337a69c20bd41aba01ba3cb802a83e
BLAKE2b-256 2da97c5574cf7149ffa6a2a2176b48204a9b375fcc7dbd4c54ac4bda20567489

See more details on using hashes here.

File details

Details for the file vonage_application-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for vonage_application-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 049fa520434aaaabd9bc6981f7fdae5b58b5f7a87e411bc6de114113c5c6536a
MD5 893577df6a78950a3fa7c2b2fccf48ca
BLAKE2b-256 002a17be1de25d6e287525b3e88e94844b458dc1c5f699312cade67d329f5686

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