Skip to content
Adnan Hajdarević edited this page Mar 21, 2015 · 12 revisions

Hook definition

Hooks are defined as JSON objects. Please note that in order to be considered valid, a hook object must contain the id and execute-command properties. All other properties are considered optional.

Properties (keys)

  • id - specifies the ID of your hook. This value is used to create the HTTP endpoint (http://yourserver:port/hooks/your-hook-id)
  • execute-command - specifies the command that should be executed when the hook is triggered
  • command-working-directory - specifies the working directory that will be used for the script when it's executed
  • response-message - specifies the string that will be returned to the hook initiator
  • parse-parameters-as-json - specifies the list of arguments that contain JSON strings. These parameters will be decoded by webhook and you can access them like regular objects in rules and pass-arguments-to-command.
  • pass-arguments-to-command - specifies the list of arguments that will be passed to the command. Check Referencing request values page to see how to reference the values from the request.
  • trigger-rule - specifies the rule that will be evaluated in order to determine should the hook be triggered. Check Hook rules page to see the list of valid rules and their usage

Examples

Check out Hook examples page for more complex examples of hooks.

This is very important and helpful resources for planning

Clone this wiki locally