Add webhook support #1

Open
opened 2023-08-05 20:37:10 +00:00 by brajkovic · 0 comments
Owner

Add support for webhooks,

There are multiple events supported:

  • created - when a new holiday is added
  • updated - when an existing holiday is updated
  • deleted - when a holiday is deleted

When creating a webhook there are two ways of filtering:

  • user can select a country for which events are emitted
  • user can select one or more events that are sent to a url

Webhook can also retry for up to 10 times (this is defined in webhook definition), this is only stopped when request returns 200, or when retrylimit is met

Webhook send Authorization: Api $key that can be used validate sender

Webhook send a post request containg a json holiday object as below

{
  event: 'created' | 'updated' | 'deleted',
  holiday: {
    id: uuid,
    name: string,
    description: string,
    country: string,
    date: string (yyyy-MM-dd),
    is_state_holiday: bool,
    is_religious_holiday: bool,
  }
}

If there are multiple pending events, they are guaranteed to be sent in the creation order

Add support for webhooks, There are multiple events supported: * **created** - when a new holiday is added * **updated** - when an existing holiday is updated * **deleted** - when a holiday is deleted When creating a webhook there are two ways of filtering: * user can select a country for which events are emitted * user can select one or more events that are sent to a url Webhook can also retry for up to 10 times (this is defined in webhook definition), this is only stopped when request returns 200, or when retrylimit is met Webhook send `Authorization: Api $key` that can be used validate sender Webhook send a post request containg a json holiday object as below ``` { event: 'created' | 'updated' | 'deleted', holiday: { id: uuid, name: string, description: string, country: string, date: string (yyyy-MM-dd), is_state_holiday: bool, is_religious_holiday: bool, } } ``` If there are multiple pending events, they are guaranteed to be sent in the creation order
brajkovic added reference feature/1_add_webhook_support 2023-08-06 13:15:38 +00:00
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: brajkovic/holiday-api#1
No description provided.