Difference between revisions of "Webhooks"

From Hornbill
Jump to navigation Jump to search
Line 5: Line 5:
  
 
[[Category:Integration]]
 
[[Category:Integration]]
 +
 +
=== Example Integration ===
 +
An example to reading the JSON payload from a webhook can be found on [https://github.com/hornbill/goWebhookListener GitHub] - The code is avialable for use under the [https://wiki.hornbill.com/index.php/The_Hornbill_Community_License_(HCL) Hornbill Community Licence].

Revision as of 20:37, 12 December 2015

A web hook is the opposite to an API call, a web hook is a call over HTTP from your Hornbill instance to a web endpoint of your choosing. Most application actions on a Hornbill instance can trigger an action-specific event when an action is performed. Hornbill can be configured to call to a web end point passing the action-specific data to the web service being invoked. This is a very powerful mechanism that enables true, near real-time integration with other business systems.

HTTP Protocol Information

Your web hook should accept a POST verb with either XML or JSON content as the payload (set by webhook properties). For pre-action hooks such as OnCreate, OnUpdate and OnDelete asyncCritical types it is possible to send an error message from your web hook back to the user's screen. To do this simply respond with a 403 response code, set the Content-type: header to text/plain and the actual text message you want to return to the users display in the response body, the response body should be returned as UTF-8 encoded bytes if non-ascii content is requited.

Example Integration

An example to reading the JSON payload from a webhook can be found on GitHub - The code is avialable for use under the Hornbill Community Licence.