- Webhooks push each event to your server as it happens.
GET /project_eventslets you pull the events from the last 30 days whenever you ask.
id, type and data. Use webhooks to react quickly,
and the list endpoint to make sure you haven’t missed anything.
Why webhooks alone aren’t enough
Webhooks are the fastest way to learn about an event, but some events can fail to reach you:- Retries end. A failed delivery is retried for about 31 hours, then given up. If your server is down or returning errors for longer than that, those events are never delivered.
- Your server can lose an event it accepted. Pocketflows treats any
2xxresponse as delivered and doesn’t send that event again. If your code returns2xxand then fails to process the event, nothing will resend it. - Webhooks only receive new events. A webhook gets the events created after you set it up, and only the event types you selected for it. Events from before then, or of other types, are never sent to it.
GET /project_events, whether or not a webhook
received it. Fetching the events you haven’t seen yet closes each of these gaps.
Using both
Handle webhooks as they arrive, and fetch new events from the API on a schedule, for example every few minutes, to catch anything a webhook missed. Your handler will see some events twice, once from each source, and webhook retries can repeat events too. Record theid of each event you have
processed and skip any you have already seen.
Don’t rely on the order events reach you. Webhooks can arrive out of order, and an event can appear
in the list shortly after events created later than it.
If your integration can wait a few minutes to learn about events, you can skip webhooks and only
fetch new events from the API.
Related
- Fetch new events from the API for the requests to make.
- Webhooks for the payload shape, retry schedule and event types.
GET /project_eventsfor the endpoint’s parameters.