GET /webhooks
Gets a list of all webhook subscriptions, whether for an account or a specific application. This list is an array containing the full resource description of each subscription.
Request
GET https://api.tropo.com/v1/webhooks/
Headers
This request must be authenticated with HTTP Basic authentication using your Tropo account credentials.
Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l
Query String Filters
- event
- Shows only webhook subscriptions with an event matching this query string. Example:
/v1/webhooks/?event=ratedCDR
- resource
- Shows only webhook subscriptions for a resource that matches this query string. Example:
/v1/webhooks/?resource=call
Filters can be combined by adding query string parameters. For example /v1/webhooks/?event=ratedCDR&resource=call
would show all webhook subscriptions for rated CDRs for calls.
Response
Fields
- id
- (Integer) The unique ID of the webhook subscription.
- accountId
- (Integer) The Tropo account owning the webhook subscription.
- applicationId
- (Integer) Present only if the subscription is tied to an application instead of an account, this will be the application ID the subscription is for.
- event
- (String) Which event this subscription is for. Possible values are
smsdlr
,cdrCreated
, orcdrRated
. See the webhook documentation for details on each event type. - 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.
- targetUrl
- (String) The URL of your web application where the event notification will be sent.
- payload
- (Object) A freeform JSON object containing arbitrary user-defined data that you wish to include with your event notifications. This field is only returned if it was set by the user when creating the subscription.
- enabled
- (Boolean) Is this subscription active? If set to False, Tropo will not send you the event notifications.
- href
- (String) The URL to the webhook resource.
Example
[{ "id": 12300, "event": "smsdlr", "name": "Delivery reports", "targetUrl": "http://example.com/dlr", "resource" : "all", "accountId": "157223", "applicationId": "599202", "enabled": true, "href": "https://api.tropo.com/v1/applications/599202/webhooks/12" }, { "id": 12301, "event": "cdrCreated", "name": "CDR handler", "targetUrl": "http://example.com/dlr", "resource": "call", "accountId": "157223", "payload": { "apiKey" : "6Tg4CD3GBvmjh897hfgbdgh"}, "enabled": false, "href": "https://api.tropo.com/v1/webhooks/12" }]