Testing Webhooks
3 minutes to readYou can use different methods to verify if a webhook is configured correctly:
- As an initial check, make a change in the table that is set in the event definition and check if this action triggers the webhook to send a message.
- In the list of events for a given webhook, view statistics for messages, calls, and errors related to a specific event:
- In the Activity period list, select the timeframe for which you want to view the delivery statistics.
- In the Messages column, check how many webhook messages were created.
- In the Calls column, verify how many POST requests the webhook sent.
- In the Errors column, confirm whether any errors occurred for this event.
- For detailed analysis, use the prefiltered logs for webhooks and events available in the More menu for webhooks and events. You can also click the values in the Messages, Calls, and Errors columns to open the logs filtered for that event (applies only to values that are other than 0). In the logs, you can then view the details of any webhook message by hovering over a row and clicking the Details button. The available information includes the request and response content, as well as the payload of the outgoing webhooks. Learn more about logs.
Note: If you set short retention for logs, the numbers of messages, calls, and errors in the lists of webhooks and events might be different than the number of corresponding logs.
Note: In rare cases, the confirmation that a webhook message has been received might not arrive before the webhook times out. As a result, the logs might show a failed status, even though the webhook was delivered successfully. To avoid this situation, configure your target service to send the confirmation first, before verifying the payload.
Steps to check webhook and event statistics through Caspio REST API
Use the following operations to programmatically check the number of messages, calls, and errors for a webhook through Caspio REST API. For a full list of available operations, see our Swagger UI documentation.
- Check the number of messages, calls, and errors for a webhook:
GET /v2/outgoingWebhooks/{webhookId}
- Check the number of messages, calls, and errors for an event:
GET /v2/outgoingWebhooks/{webhookId}/events/{eventId}
In this example, using a GET method, you can check the detailed statistics for your outgoing webhook.
Response:
{
"Id": "0923gp",
"Name": "MyTestWebhook",
"Description": "Send messages whenever changes in table MyCustomers occur",
"OutgoingUrls": [
"https://www.test.com/89lnuuy6999ss",
"https://www.test.com/79hjy76788hbk"
],
"CallThrottling": 8,
"Events": 3,
"Messages": 55,
"Calls": 55,
"Errors": 0,
"LastModified": "2023-07-25T09:27:25.239Z",
"ModifiedBy": ""John Doe (john.doe@acme.com)",
"DateCreated": "2023-07-23T10:12:45.239Z",
"CreatedBy": "John Doe (john.doe@acme.com)"
}