Testing & Monitoring a Webhook

Send a manual test event to a webhook and retrieve its delivery logs.

Testing a webhook

Once a webhook has been created, test it manually:

POST https://api.getguru.com/api/v1/webhooks/{webhookId}/test

The request body should be an event matching the format the webhook would deliver.

Request

curl -X POST https://api.getguru.com/api/v1/webhooks/{webhookId}/test \
  -u $GURU_USER:$GURU_TOKEN \
  -H "Content-Type: application/json" \
  -d '{
    "id": "64753163-9817-4500-9651-96177c32e3d1",
    "eventType": "card-created",
    "user": "[email protected]",
    "eventDate": "2021-04-13T13:53:00.000+0000"
  }'

Monitoring a webhook

Webhooks email the owner when important errors occur, such as events dropped due to undeliverability. In addition, the current logs for a webhook (kept for at most two weeks) can be retrieved:

GET https://api.getguru.com/api/v1/webhooks/{webhookId}/logs

Results are returned newest to oldest, at most 50 per page, and can be paged using the standard paging mechanism. The request supports optional startDate and endDate query parameters to get logs for a specific time frame.

Response

[
  {
    "level": "ERROR",
    "message": "[404] Webhook operation failed (post operation returned unexpected code); statusCode = 404",
    "timestamp": "2021-05-19T14:25:57.974+0000"
  },
  {
    "level": "ERROR",
    "message": "[404] Webhook operation failed (post operation returned unexpected code); statusCode = 404",
    "timestamp": "2021-05-19T14:25:12.547+0000"
  }
]