Skip to content

Commit

Permalink
AGX-2496/Webhooks-Documentation (#206)
Browse files Browse the repository at this point in the history
* AGX-2496/Webhooks-Documentation

Adding possibility of `outcome` returning `discarded`. Also, changing the wording to show that flushed queue show as outcome `discarded` and not `failed` anymore.

* Adding discarded as a filter possibility.
  • Loading branch information
dannyporrello authored Jan 2, 2024
1 parent 0fc2d2c commit 2bbd565
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion webhooks/webhooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ One approach to handling this scenario is to log each processed event, and then

When a Webhook delivery fails, due to a failure to establish a connection to the destination URL, the destination returning a non-2XX response code, or the request timing out (5 seconds), all future deliveries to that endpoint will be paused.
The failing Webhook will then be retried using an exponential backoff scheme, starting with a 1 second interval and with a maximum interval of 1 hour.
After 12 hours of retrying event delivery to that destination URL, the delivery queue will be flushed and all queued events will be marked as `failed`.
After 12 hours of retrying event delivery to that destination URL, the delivery queue will be flushed and all queued events will be marked as `discarded`.
When the next new Webhook to be delivered is ready, it will attempt to deliver it from a fresh start, beginning a new retry cycle if the destination URL remains unavailable.
If at any point during the retry cycle a successful delivery occurs, the system will resume sending events as normal and all retry counters will be reset.

Expand Down
6 changes: 3 additions & 3 deletions webhooks/webhooks_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ The following table describes the various attributes of the List Webhooks Delive
| response_headers | Object containing key/value pairs representing the HTTP header fields included in the response to the webhooks delivery POST call. |
| response_error | Error response message, if applicable. |
| response_body | Content of the HTTP response body resulting from the webhooks delivery POST call. |
| outcome | Result for the webhooks event delivery attempt. Can be one of 'ok', 'retried', or 'failed'. |
| outcome | Result for the webhooks event delivery attempt. Can be one of 'ok', 'discarded', 'retried', or 'failed'. |
| id | Unique identifier for the delivery. |
| event_id | Unique identifier for the webhooks event for which a delivery was attempted. |
| event | The event object containing the following properties:<br>- _user_id_ - ID for the User that initiated the event.<br>- _timestamp_ - UTC date/time when the event occurred.<br>- _resource_name_ - Name of the Resource in which the event occurred.<br>- _resource_id_ - ID for the Resource in which the event occurred.<br>- _project_id_ - ID of the Project in which the event occurred.<br>- _id_ - ID for the event.<br>- _event_type_ - Type of event - will be 'create', 'update', or 'delete'.<br>- _company_id_ - ID of the Company in which the event occurred.<br>- _api_version_ - Procore API version.<br>- _metadata_ - An object containing contextual information about the event.<br>- _ulid_ - Unique identifier encoded as a 26 character string. See [ULID specification](https://github.com/ulid/spec) for additional information. |
Expand All @@ -161,15 +161,15 @@ The following table describes the various attributes of the List Webhooks Delive
### Filtering the List Webhooks Deliveries Response

Due to the potential large volume of webhooks deliveries your system might be required to consume, you may find it helpful to filter the response from the List Webhooks Deliveries call using the `filters[status]` query parameter.
This query parameter lets you limit the response to 'any' (default), 'successful', or 'failing' webhooks deliveries.
This query parameter lets you limit the response to 'any' (default), 'successful', 'discarded', or 'failing' webhooks deliveries.
Here is the syntax for using the `filters[status]` query parameter.

```
https://api.procore.com/rest/v1.0/webhooks/hooks/<HOOK_ID>/deliveries?company_id=<COMPANY_ID>&filter[status]=<FILTER_VALUE>
where: <HOOK_ID> is the ID for webhook hook
<COMPANY_ID> is the ID for company (could also be <PROJECT_ID>)
<FILTER_VALUE> is the filter setting - either 'any', 'successful', or 'failing'
<FILTER_VALUE> is the filter setting - either 'any', successful', 'discarded', or 'failing'
example: curl -X GET https://api.procore.com/rest/v1.0/webhooks/hooks/12345/deliveries?
company_id=987654&filter[status]=failing
Expand Down

0 comments on commit 2bbd565

Please sign in to comment.