Tropo is part of CiscoLearn More

PUT /applications/:id/webhooks/:id

Updates an application-level webhook subscription.

Request

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

Because each webhook subscription has a unique ID, an application-level subscription is addressable either by including the application ID in the URL or by using only the webhook ID.

Headers

This request must be authenticated with HTTP Basic authentication using your Tropo account credentials and contain a content-type of application/json

Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l
Content-Type: application/json

Body

{
  "targetUrl": "http://example.com/dlr",
  "enabled": true
}

Fields included in the request will update the application with the contents of those fields. Leaving a field out will leave that field unchanged. The event field cannot be changed.

Fields

event
This field cannot be changed
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.
enabled
(Boolean) Is this subscription active? If set to False, Tropo will not send the event notifications. Default is True.

Response

Returns the URL to the updated webhook subscription

{
  "href": "https://api.tropo.com/v1/application/2341/webhooks/12"
}