Webhooks are one of a few ways web apps can communicate with one another, which allows you to send real-time information from one application to another whenever certain events occur. Webhooks can be created and configured to handle event notifications for events you would like to be notified about.
Working with Webhook Event Notifications
When working with webhook event notifications, each event notification request will contain two headers from Loopio:
X-Loopio-Content-Signature: The JSON-encoded body of the request, hashed by the webhook's signing secret. See our article How Do I Use My Signing Secret? for more information.
X-Loopio-Request-Timestamp: The timestamp of when the request was sent.
The body of each event notification request has the same general structure, with an event property containing the name of the event and a context property containing the details of that event.
What Events Can Webhooks Subscribe To?
You can currently subscribe to Library Entry Updates, Library Review Assignments and Project Status Changes.
Library Entry Update
This event is triggered whenever one or more Library Entries are updated. The request body will look something like this:
"libraryEntryIds": [1, 2, 3]
It contains the IDs of the Library Entries that have been updated.
Library Review Assignment
This event is triggered whenever a Library Review is created and assigned to someone. The request body will look something like this:
It contains information about the Library Review, who assigned it, who it was assigned to, as well as its due date.
Project Status Changes
This event is triggered whenever a Project status has been updated. The request body will look something like this:
It contains information about the Project, as well as what the Project’s status was changed to.
How to Handle a Webhook Event Notification
When you receive a notification for an event your webhook is subscribed to, you should verify the request came from Loopio and respond to our request with a HTTP 200 status for your webhook to remain active.
If we receive a response other than a HTTP 200 status:
- No response: we will retry sending the event notification two more times. If we still have not received a HTTP 200 status after those attempts, your webhook will be deactivated.
- HTTP 4xx statuses: your webhook will be deactivated immediately.
- Any other response: we will retry sending the event notification two more times. If we still have not received a HTTP 200 status after those attempts, your webhook will be deactivated.
Deactivated webhooks will need to be reactivated through our webhook URL validation. You can learn more about this process by reading our How Do I Validate My Webhook URL? article.