diff --git a/README.md b/README.md index e6c11bbc..845c9757 100644 --- a/README.md +++ b/README.md @@ -2961,6 +2961,8 @@ In addition to the [Standard Response Format](#standard-response-format), the ID If [Allow Queued Jobs](#allow-queued-jobs) is enabled on the event, the API response will also include a `queue` property, which will be set to the number of jobs currently queued up. +**Advanced Tip:** If you do not wish to merge the POST data into the `params` (for example if you are using a webhook that provides other data as JSON), then you can add `&post_data=1` to the query string. If you do this, then the POST data will be available in the `post_data` key of the `params` object. + ### get_job_status ``` diff --git a/lib/api/event.js b/lib/api/event.js index c2fb4bba..8735f3d4 100644 --- a/lib/api/event.js +++ b/lib/api/event.js @@ -339,9 +339,14 @@ module.exports = Class.create({ // run event manually (via "Run" button in UI or by API Key) // can include any event overrides in params (such as 'now') var self = this; - var params = Tools.mergeHashes( args.params, args.query ); if (!this.requireMaster(args, callback)) return; + // default behavor: merge post params and query together + // alt behavior (post_data): store post params into post_data + var params = Tools.copyHash( args.query, true ); + if (args.query.post_data) params.post_data = args.params; + else Tools.mergeHashInto( params, args.params ); + var criteria = {}; if (params.id) criteria.id = params.id; else if (params.title) criteria.title = params.title; diff --git a/package.json b/package.json index 12fbe140..c4ae02d1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "Cronicle", - "version": "0.8.38", + "version": "0.8.39", "description": "A simple, distributed task scheduler and runner with a web based UI.", "author": "Joseph Huckaby ", "homepage": "https://github.com/jhuckaby/Cronicle",