Webhooks 

You can use webhooks to receive a notification when an action is performed within Communico, for example when an event is created or updated or when an appointment is created, updated or cancelled. 

How it works

An HTTP POST is submitted to each subscription URL with relevant data, in JSON format, when a hook is triggered.

Payloads contain different data depending on the hook being triggered but all are arranged in the following format.


Processing and order

Hooks are batched and processed every 5 seconds, ordering is not guaranteed and the time stamp should be checked by the subscription handler.

Usage limits

There is no limit to the number of subscriptions or hooks that can be created but creating a large amount of subscriptions to the same hook can result in a delay.

Failed subscriptions

If a subscription fails, such as the URL being unavailable, retries are not made. If a URL consistently fails it may be grey listed for a short period of time, start at 1 minute and doubling each time until 1 day is reached.

Creating webhook subscriptions

New webhook subscriptions can be added via the control panel under Settings.

1. Click the Webhooks setting and then click the   new webhook button.


2. Give the webhook a name.

3. Enter the url the notification will be sent to.

4. Select the hooks you want in the subscription. (You can add multiple hooks in the same subscription).

5. Save the webhook.


Available hooks

Below is a table of the currently available hooks and their payloads. The id, recurringId or eventId may be used in conjunction with the Communico API to pull new or updated details about the appointment, room booking or event.


eventAdded

Called when an event is added

{

recurringId: Integer

}

eventSeriesCanceledCalled when a whole event series is canceled

{

recurringId: Integer,

reason: String

}

eventCanceledCalled when a single event or a single date in a series is canceled

{

eventId: Integer,

reason: String

}

eventSeriesDeletedCalled when a whole event series is deleted

{

recurringId: Integer

}

eventDeletedCalled when a single event or a single date in a series is deleted

{

eventId: Integer,

}

eventSeriesStatusChangedCalled each time an events status is changed, for example when an event is submitted for review or when an event is published

{

recurringId: Integer,

newStatus: String

}

eventRescheduledCalled when an event is rescheduled

{

oldEventId: Integer,

newEventId: Integer,

reason: String

}

userRegisteredForEventCalled when a user registers for an event

{

registrationId: Integer,

eventId: Integer

}

roomBookingNoShowCalled when a room booking is marked no show

{

bookingId: Integer

}

roomBookingCreatedCalled when a room booking is created

{

bookingId: Integer

}

roomBookingUpdatedCalled when a room booking is updated

{

bookingId: Integer

}

roomBookingDeletedCalled when a room booking is deleted

{

bookingId: Integer

}

roomBookingStatusChangedCalled when the status is changed on a room booking

{

bookingId: Integer,

status: String,

statusText: String

}

appointmentCreatedCalled when a new appointment is created

{

Id: Integer

}

appointmentUpdatedCalled when an existing appointment is updated

{

Id: Integer

}

appointmentCancelledCalled when an appointment is cancelled

{

Id: Integer

}