Tropo is part of CiscoLearn More

Webhooks

Webhooks allow Tropo to send event notifications such as message delivery reports to your web application. The /webhooks resource provides API access to set up and manage your webhook subscriptions.

Webhook subscriptions can be at the account level or the application level. When at the account level, they apply to all applications in an account. When at the application level, only events for that application will trigger the notification.

Tropo limits each account to 10 account-level webhook subscriptions and 10 subscriptions per application.

Resource URL

https://api.tropo.com/v1/webhooks/
https://api.tropo.com/v1/applications/:id/webhooks/

HTTP Methods

GET https://api.tropo.com/v1/webhooks/
Lists your account-level webhook subscriptions.
GET https://api.tropo.com/v1/webhooks/:id
Shows the details of a single webhook subscription. Because webhook subscription IDs are unique, either an account-level or an application-level webhook subscription can be viewed this way.
POST https://api.tropo.com/v1/webhooks/
Creates an account-level webhook subscription.
PUT https://api.tropo.com/v1/webhooks/:id
Updates a webhook subscription. Because webhook subscription IDs are unique, either an account-level or an application-level webhook subscription can be updated this way.
DELETE https://api.tropo.com/v1/webhooks/:id
Removes a webhook subscription. Because webhook subscription IDs are unique, either an account-level or an application-level webhook subscription can be removed this way.
GET https://api.tropo.com/v1/applications/:id/webhooks/
Lists your application-level webhook subscriptions.
GET https://api.tropo.com/v1/applications/:id/webhooks/:id
Shows the details of a single application-level webhook subscription. The API call /v1/webhooks/:id (ommitting the application/:id) is the same as this.
POST https://api.tropo.com/v1/applications/:id/webhooks/
Creates an application-level webhook subscription. The API call /v1/webhooks/:id (ommitting the application/:id) is the same as this.
PUT https://api.tropo.com/v1/applications/:id/webhooks/:id
Updates an application-level webhook subscription. The API call /v1/webhooks/:id (ommitting the application/:id) is the same as this.
DELETE https://api.tropo.com/v1/applications/:id/webhooks/:id
Removes an application-level webhook subscription. The API call /v1/webhooks/:id (ommitting the application/:id) is the same as this.

Useful Webhook Fields

event
(String) Which event this subscription is for. Possible values are smsdlr, cdrCreated, or cdrRated. See the webhook documentation for details on each event type. This field is required.
resource
(String) The type of resource this CDR is for. Possible values are "call", "sms", "transcription", and "all". Multiple resources can be subscribed to by separating them by commas. This field is required.
targetUrl
(String) The URL of your web application where the event notification will be sent. This field is required.
payload
(Object) A freeform JSON object containing arbitrary user-defined data that you wish to include with your event notifications. This field is optional.
enabled
(Boolean) Is this subscription active? If set to False, Tropo will not send you the event notifications. This field is optional, and defaults to True.