Loading...
Loading...
Configure notification channels and settings for account alerts and events. This skill provides Python SDK examples.
npx skill4agent add team-telnyx/telnyx-ext-agent-skills telnyx-account-notifications-pythonpip install telnyximport os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)clientGET /notification_channelspage = client.notification_channels.list()
page = page.data[0]
print(page.id)POST /notification_channelschannel_destinationchannel_type_idcreated_atidnotification_profile_idupdated_atnotification_channel = client.notification_channels.create()
print(notification_channel.data)GET /notification_channels/{id}notification_channel = client.notification_channels.retrieve(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(notification_channel.data)PATCH /notification_channels/{id}channel_destinationchannel_type_idcreated_atidnotification_profile_idupdated_atnotification_channel = client.notification_channels.update(
notification_channel_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(notification_channel.data)DELETE /notification_channels/{id}notification_channel = client.notification_channels.delete(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(notification_channel.data)GET /notification_event_conditionspage = client.notification_event_conditions.list()
page = page.data[0]
print(page.id)GET /notification_eventspage = client.notification_events.list()
page = page.data[0]
print(page.id)GET /notification_profilespage = client.notification_profiles.list()
page = page.data[0]
print(page.id)POST /notification_profilescreated_atidnameupdated_atnotification_profile = client.notification_profiles.create()
print(notification_profile.data)GET /notification_profiles/{id}notification_profile = client.notification_profiles.retrieve(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(notification_profile.data)PATCH /notification_profiles/{id}created_atidnameupdated_atnotification_profile = client.notification_profiles.update(
notification_profile_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(notification_profile.data)DELETE /notification_profiles/{id}notification_profile = client.notification_profiles.delete(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(notification_profile.data)GET /notification_settingspage = client.notification_settings.list()
page = page.data[0]
print(page.id)POST /notification_settingsassociated_record_typeassociated_record_type_valuecreated_atidnotification_channel_idnotification_event_condition_idnotification_profile_idparametersstatusupdated_atnotification_setting = client.notification_settings.create()
print(notification_setting.data)GET /notification_settings/{id}notification_setting = client.notification_settings.retrieve(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(notification_setting.data)DELETE /notification_settings/{id}notification_setting = client.notification_settings.delete(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(notification_setting.data)