You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> A valid webhook must consist of the following properties:
166
+
> - ```url``` The configured URL which will trigger the webhook when a selected event occurs.
167
+
> - ```method``` The methods to map CRUD (create, retrieve, update, delete) operations to HTTP requests.
168
+
> - ```encoding``` The format in which the payload will be returned. You can choose from ```JSON```, ```FORM_ENCODED``` or ```XML```. This will automatically add the Content-Type header for you so you don't have to add it again in the `headers` property.
169
+
> - ```headers``` HTTP header fields which provide required information about the request or response, or about the object sent in the message body. This should not include the `Content-Type` header.
170
+
> - ```events``` Event or events that will trigger the webhook. Atleast one event should be present.
171
+
> - ```template``` The structure of the payload that will be returned.
172
+
> #### Types of Events
173
+
> You can select all of the events (listed below) or combine them in whatever way you like but atleast one event must be used. Otherwise, the webhook won't be created.
174
+
> A webhook will be triggered when any one or more of the events occur:
175
+
> + **SMS**
176
+
> + `RECEIVED_SMS` Receive an SMS
177
+
> + `OPT_OUT_SMS` Opt-out occured
178
+
> + **MMS**
179
+
> + `RECEIVED_MMS` Receive an MMS
180
+
> + **DR (Delivery Reports)**
181
+
> + `ENROUTE_DR` Message is enroute
182
+
> + `EXPIRED_DR` Message has expired
183
+
> + `REJECTED_DR` Message is rejected
184
+
> + `FAILED_DR` Message has failed
185
+
> + `DELIVERED_DR` Message is delivered
186
+
> + `SUBMITTED_DR` Message is submitted
187
+
> #### Template Parameters
188
+
> You can choose what to include in the data that will be sent as the payload via the Webhook.
189
+
> Keep in my mind, you must escape the JSON in the template value (see example above).
190
+
> The table illustrates a list of all the parameters that can be included in the template and which event types it can be applied to.
191
+
> | Data | Parameter Name | Example | Event Type |
> *Note: A 400 response will be returned if the `url` is invalid, the `events`, `encoding` or `method` is null or the `headers` has a Content-Type attribute.*
> This will retrieve all webhooks for the account we're connected with.
268
-
> a **Response 400 is returned when** :
269
-
> <ul>
270
-
> <li>the `page` query parameter is not valid </li>
271
-
> <li>the `pageSize` query parameter is not valid </li>
272
-
> </ul>
302
+
> Delete a webhook that was previously created for the connected account.
303
+
> A webhook can be cancelled by appending the UUID of the webhook to the endpoint and submitting a DELETE request to the /webhooks/messages endpoint.
304
+
> *Note: Only pre-created webhooks can be deleted. If an invalid or non existent webhook ID parameter is specified in the request, then a HTTP 404 Not Found response will be returned.*
> This will update a webhook and returned the updated Webhook.
311
-
> you can update all the attributes individually or together.
312
-
> PS : the new value will override the previous one.
313
-
> ### Parameters
314
-
> + same parameters rules as create webhook apply
315
-
> a **Response 404 is returned when** :
316
-
> <ul>
317
-
> <li>there is no webhook with this `webhookId` </li>
318
-
> </ul>
319
-
> a **Response 400 is returned when** :
320
-
> <ul>
321
-
> <li>all attributes are null </li>
322
-
> <li>events array is empty </li>
323
-
> <li>content-Type is set in the headers instead of using the `encoding` attribute </li>
324
-
> </ul>
338
+
> Update a webhook. You can update individual attributes or all of them by submitting a PATCH request to the /webhooks/messages endpoint (the same endpoint used above to delete a webhook)
339
+
> A successful request to the retrieve webhook endpoint will return a response body as follows:
> *Note: Only pre-created webhooks can be deleted. If an invalid or non existent webhook ID parameter is specified in the request, then a HTTP 404 Not Found response will be returned.*
0 commit comments