Webhooks
A webhook (also called a web callback or HTTP push API) is a way for an app to provide other applications with real-time information. A webhook delivers data to other applications as it happens, meaning you get data immediately.
Host Building can publish webhooks to external systems when certain events occur. These contains information about the event and the triggering user.
When subscribing, you will receive all hooks for the requested category. E.g. If you require tenant
hooks, you will receive the events for tenant_created
, tenant_enabled
...
Request signing
We sign each webhook call with a signature in the request header. This will allow any third party to verify that a request was sent by Host.
When a webhook is created for a client we auto-generate a secret key for each endpoint and we use that secret key to sign the request. The signature is added into the header of that request under the 'Host-Signature' attribute.
See Webhook Signing for more information.
Configuring webhooks
We don't currently offer self-service configuration for webhooks.
Contact Host Building with your endpoint and the events you want to subscribe to. You will be provided with a signature secret to use when verifying the source of the webhook.
Structure
All webhooks follow a common structure. All dates are UTC timezone, ISO-8601 formatted.
{
"event": "event_booked",
"event_at": "2022-05-03 18:12:13",
"source": "au.host-building.com",
"data": {
"properties": "string"
}
}
Available hooks
- Event Bookings
- Service Bookings
- Space Bookings
- Tenants
- App Users
Event booked
Triggered when a user books an event.
{
"event": "event_booked",
"event_at": "2022-05-03 18:12:13",
"source": "au.host-building.com",
"data": {
"id": 1233,
"event_id": 52,
"event_name": "Example event",
"event_image": "https://cdn.au.host-building.com/data/image.png",
"user": {
"id": 1123123,
"name": "Test user",
"email": "test@cbre.com",
},
"session_start": "2022-09-12 18:00:00", // UTC
"session_end": "2022-09-12 19:00:00", // UTC
"cost": "$20.00"
}
}
Service Booked
Triggered when a user books a service in the Host service desk.
{
"event": "service_booked",
"event_at": "2022-05-03 18:12:13",
"source": "au.host-building.com",
"data": {
"id": 1,
"category": "Amenities",
"service_id": 14,
"service_name": "Shower access",
"service_building": "Test building",
"service_image": "https://cdn.au.host-building.com/data/image.png",
"user": {
"id": 1123123,
"name": "Test user",
"email": "test@cbre.com",
},
"custom_fields": {
"Field": "value"
}
}
}
Space Booked
Triggered when a user books a space in the Host app.
{
"event": "space_booked",
"event_at": "2022-08-03T03:00:47+00:00",
"source": "au.host-building.com",
"data": {
"id": 2477,
"space_id": 18,
"space_name": "Space test space",
"start_time": "2022-08-30T15:00:00+10:00",
"end_time": "2022-08-30T17:00:00+10:00",
"attendees": 2,
"status": "approved",
"user": {
"id": 12345,
"name": "Joe Host",
"email": "joe@host.com"
},
"custom_fields": [
{
"label": "afd",
"value": "OneTwoThreeFour x 2, TwoThreeFour",
"field_id": 417,
"value_id": 5671
},
{
"label": "Comments",
"value": "Wergsdfer",
"field_id": 419,
"value_id": 5672
{
"label": "Checkin Time",
"value": "08:35",
"field_id": 436,
"value_id": 5676
}
]
}
}
Space Booking Approved
When a booking for a space requiring approval is approved.
{
"event": "space_booking_approved",
"event_at": "2022-08-17T04:44:09+00:00",
"source": "test.host-building.com",
"data": {
"id": 2332,
"space_id": 72,
"space_name": "pending test space - no cost",
"start_time": "2022-08-22T11:00:00+10:00",
"end_time": "2022-08-22T12:00:00+10:00",
"attendees": 4,
"status": "approved",
"user": {
"id": 48481,
"name": "Johan Bluff",
"email": "jb@eeyy.moc"
},
"custom_fields": []
}
}
Space Booking Cancelled
When a booking for a space is cancelled.
{
"event": "space_booking_cancelled",
"event_at": "2022-08-24T04:29:09+00:00",
"source": "test.host-building.com",
"data": {
"id": 2369,
"space_id": 72,
"space_name": "pending test space - no cost",
"start_time": "2022-08-25T09:30:00+10:00",
"end_time": "2022-08-25T10:30:00+10:00",
"status": "pending",
"user": {
"id": 48512,
"name": "Billy Tea",
"email": "bt@leaf.moc"
}
}
}
Space Booking Declined
When a booking for a space is declined.
{
"event": "space_booking_declined",
"event_at": "2022-09-16T06:08:33+00:00",
"source": "test.host-building.com",
"data": {
"id": 2334,
"space_id": 18,
"space_name": "Space with cost",
"start_time": "2022-09-20T11:00:00+10:00",
"end_time": "2022-09-20T13:00:00+10:00",
"status": "declined",
"user": {
"id": 48485,
"name": "Beetson Glubs",
"email": "bg@sss.moc"
}
}
}
Tenant Created
When a next tenant is created.
{
"event": "tenant_created",
"event_at": "2022-05-03 18:12:13",
"source": "au.host-building.com",
"data": {
"id": 1233,
"name": "Test tenant"
}
}
Tenant Enabled
When a tenant is enabled.
{
"event": "tenant_enabled",
"event_at": "2022-05-03 18:12:13",
"source": "au.host-building.com",
"data": {
"id": 1233,
"name": "Test tenant"
}
}
Tenant Disabled
When a tenant is disabled.
{
"event": "tenant_disabled",
"event_at": "2022-05-03 18:12:13",
"source": "au.host-building.com",
"data": {
"id": 1233,
"name": "Test tenant"
}
}
App User Registered
When a user registeres to the app.
{
"event": "app_user_registered",
"event_at": "2022-08-16T08:05:31+00:00",
"source": "au.host-building.com",
"data": {
"id": 48481,
"building_id": 152,
"client_id": 14,
"tenant_id": 822,
"first_name": "Johan",
"last_name": "Bluff",
"email": "jb@eeyy.moc"
}
}