Webhooks
Webhooks can be configured by adding them to webhook clients. Webhooks can only be added to an already existing client.
Webhooks belonging to the selected client are listed on this page.
To add a new webhook simply click on the Add New Webhook button in the upper-right corner.
In the appearing modal you will be prompted to select an entity, a supported entity operation and an HTTP method, and to provide a path for the webhook.
Each time the configured operation is executed, an HTTP request will be made to the configured url eg. http://localhost:8080/events/1
The webhook's path can optionally contain variables that will be substituted with properties of the entity. Variables can be included in the path by adding the case sensitive variable name in curly brackets. Available variables depend on the webhook's entity and the operation.
The request's Authorization header will be set based on the webhook client's configuration.
The request's body is in JSON format, and depends on the webhook's entity and the operation.
Entity Types (currently supported):
Events
Operations:
- Event created
- this webhook is called for each event after it has been approved (or after it was requested, if no approval is required)
- Event updated
- this webhook is called after each time an approved event (or an event that doesn't need approval) has been updated, except if an event needs to be re-approved after an event type change, then instead of the event updated webhook:
- first the event deleted webhook will be called (after the type change)
- and then the event created webhook (after the re-approval)
- if an event's type is changed while it is still pending approval, and the event doesn't need approval after the type change, then the event created webhook will be called.
- this webhook is called after each time an approved event (or an event that doesn't need approval) has been updated, except if an event needs to be re-approved after an event type change, then instead of the event updated webhook:
- Event deleted
- this webhook is called for each event after it has been deleted (or after a type change in the above case).
Path variables:
- eventId: the event's ID
- typeId: the event's event type ID
- typeKey: the event's event type key
Request body:
The request body contains a JSON object with all properties of the event.
- Event Properties
Property name | Type | Description |
---|---|---|
id | number | Primary key of the event, used for referencing in update/delete operations |
eventType | EventType | Details of the event's type |
startDate | Date | The date the event starts |
endDate | Date | The date the event ends |
comment | string | Optional comment/description |
eventStatus | string | Status of the event (one of "REQUESTED", "APPROVED", "REJECTED") |
eventStatusByUserId | string | The ID of the user who changed the status of the event last time |
ownerId | string | The ID of the owner of the event |
halfDayLong | boolean | Indicates if the event is half day long or not |
allDayLong | boolean | Indicates if the event is all day long or not |
customDays | number | The number of the days consumed by this event |
customDuration | number | The length of the event |
tenantId | string | The ID of the tenant |
ownerUser | User | The details of the event's owner user |
actingUser | User | The details of the event's acting user (who changed the event last time) |
- EventType Properties
Property name | Type | Description |
---|---|---|
id | number | Primary key of the event type |
name | string | The name of the event type |
key | string | The key if the event type |
color | string | The configured color for the event type |
approvalRequired | boolean | Indicates if the event type requires approval or not |
syncToExternalCalendar | boolean | Indicates if the event type is syncing to external calendar or not |
active | boolean | Indicates if the event type is active or not |
eventTypeLimit | number | The default limit for the event type |
rank | number | The rank of the event type |
- User Properties
Property name | Type | Description |
---|---|---|
id | string | The identifier of the user |
username | string | The name of the user |
valid | boolean | Indicates if the user is valid or not |
Example for request body:
{
id: 1,
eventType: {
id: 1,
name: 'Home Office',
key: 'HO',
color: '#ffb86e',
approvalRequired: false,
syncToExternalCalendar: false,
active: true,
eventTypeLimit: 0,
rank: 0
},
startDate: '2023-07-14',
endDate: '2023-07-14',
comment: 'Description',
eventStatus: 'APPROVED',
eventStatusByUserId: 'fake-user-id',
ownerId: 'fake-user-id',
halfDayLong: false,
allDayLong: true,
customDays: 1,
customDuration: 1,
tenantId: 'fake-tenant',
ownerUser: {
id: 'fake-user-id',
username: 'Fake User',
valid: true
},
actingUser: {
id: 'fake-user-id',
username: 'Fake USer',
valid: true
}
}