bc-clijob webhook

Set the webhook URL that a job will execute.

Usage

job webhook (get|post|json) name URL

where
name of job whose webhook to set.
get call URL using a HTTP GET command, appending any properties
as parameters to the URL.
post call URL using a HTTP POST command, including any properties
within the message message, formatted as name/value pairs.
json call URL using a HTTP POST command, including any properties
within the message message, formatted as JSON.
URL URL to execute. See variables for available variables that can be included.
If the url host is example.com, the job will be sent to the echo URL.

write on name, and host acl permission on the host and user fields of URL.

this command will set the job type to webhook, and clear any previously set command, delay, email, host, input, message, subject and user values, as they are unused by webhook jobs.

Examples

Set a json webhook

BeyondCron % job webhook /server1/debug json http://server1/debug.php
BeyondCron % job list full debug

----------- -------------------------------- Name /server1/debug Description Log http request header and message ... Webhook http://server1/debug.php Method JSON ...

Set a POST webhook with parameters

If a URL is defined with one or parameters these will be automatically converted to job properties.

BeyondCron % job webhook /server1/debug post http://server1/debug.php?hello=world
BeyondCron % job list full debug

----------- -------------------------- Name /server1/debug Description Log http request header and message ... Webhook http://server1/debug.php Method Post Properties hello: world ...

Set a GET webhook including variables

BeyondCron % job webhook /server1/debug get \
  http://server1/debug.php?yesterday={{ time -1d EEE }}

BeyondCron % job list full debug

----------- -------------------------- Name /server1/debug Description Log http request header and message ... Webhook http://server1/debug.php Method Get Properties yesterday: {{ time -1d EEE }} ...

See also