Webhooks
Webhooks provide callbacks between your web application and CrowdFlower. This integration point allows developers working with CrowdFlower to create robust applications that interact with CrowdFlower and take actions based on the judgments that the CrowdFlower platform provides.
Basics
Webhooks are enabled by setting the webhook_uri property for a Job.
When a webhook is enabled for a Job, CrowdFlower will POST to that URL whenever an interesting event happens to your Job. See the Events section below for details on exactly which events trigger webhooks.
Each POST that your app will receive will have two parameters: signal and payload.
The signal parameter describes the type of event that has occurred. See below for the types of events and signals that will be sent.
The payload parameter will contain a JSON representation of the associated object. For example, when your job completes, you will receive the job_complete signal, and the associated payload will be a JSON representation of that Job.
unit_complete is the most frequently used webhook. The Unit includes all of the Judgments for the work completed, as well as additional useful aggregate statistics. See the Units documentation for details on its payload.
Error Handling
If CrowdFlower encounters difficulties reaching your server, it will automatically disable the webhook and send you an email informing you of the problems it has encountered with the URL you have provided. To keep the Webhook up and running correctly, please ensure that your server responds to each POST from CrowdFlower with an HTTP 200 (OK) header. The body of your response will be ignored.
Events
| Signal | Description | Payload |
|---|---|---|
| job_data_processed | The data uploaded for this Job has been processed. | Job |
| job_complete | All the judgments for the Job have been completed. | Job |
| unit_complete | One unit of work has all the judgments it needs. | Unit |
Guidelines
As our API matures, we will add support for more events. When you handle the POSTs from CrowdFlower, be sure your system responds gracefully with a 200 (OK) to new signal types. A future version of the API will allow subscribing and unsubscribing from different event types independently.