diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | app/Controller/Webhook.php | 42 | ||||
-rw-r--r-- | app/Template/config/webhook.php | 6 | ||||
-rw-r--r-- | doc/webhooks.markdown | 33 |
4 files changed, 5 insertions, 80 deletions
@@ -22,6 +22,10 @@ Bug fixes: * Do not send notifications to disabled users +Breaking changes: + +* Webhook to create tasks have been removed, use the API instead. + Version 1.0.28 -------------- diff --git a/app/Controller/Webhook.php b/app/Controller/Webhook.php deleted file mode 100644 index 6e172aeb..00000000 --- a/app/Controller/Webhook.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php - -namespace Kanboard\Controller; - -/** - * Webhook controller - * - * @package controller - * @author Frederic Guillot - */ -class Webhook extends BaseController -{ - /** - * Webhook to create a task - * - * @access public - */ - public function task() - { - $this->checkWebhookToken(); - - $defaultProject = $this->project->getFirst(); - - $values = array( - 'title' => $this->request->getStringParam('title'), - 'description' => $this->request->getStringParam('description'), - 'color_id' => $this->request->getStringParam('color_id'), - 'project_id' => $this->request->getIntegerParam('project_id', $defaultProject['id']), - 'owner_id' => $this->request->getIntegerParam('owner_id'), - 'column_id' => $this->request->getIntegerParam('column_id'), - 'category_id' => $this->request->getIntegerParam('category_id'), - ); - - list($valid, ) = $this->taskValidator->validateCreation($values); - - if ($valid && $this->taskCreation->create($values)) { - return $this->response->text('OK'); - } - - return $this->response->text('FAILED'); - } -} diff --git a/app/Template/config/webhook.php b/app/Template/config/webhook.php index 5db1fa6e..3bba907c 100644 --- a/app/Template/config/webhook.php +++ b/app/Template/config/webhook.php @@ -16,7 +16,7 @@ </section> <div class="page-header"> - <h2><?= t('URL and token') ?></h2> + <h2><?= t('Webhook token') ?></h2> </div> <section class="listing"> <ul> @@ -25,10 +25,6 @@ <strong><?= $this->text->e($values['webhook_token']) ?></strong> </li> <li> - <?= t('URL for task creation:') ?> - <input type="text" class="auto-select" readonly="readonly" value="<?= $this->url->href('webhook', 'task', array('token' => $values['webhook_token']), false, '', true) ?>"> - </li> - <li> <?= $this->url->link(t('Reset token'), 'config', 'token', array('type' => 'webhook'), true) ?> </li> </ul> diff --git a/doc/webhooks.markdown b/doc/webhooks.markdown index d6d22400..628c7e38 100644 --- a/doc/webhooks.markdown +++ b/doc/webhooks.markdown @@ -269,36 +269,3 @@ Screenshot created: } } ``` - -How to create a task with a web hook? -------------------------------------- - -Firstly, you have to get the token from the settings page. After that, just call this url from anywhere: - -```bash -# Create a task for the default project inside the first column -curl "http://myserver/?controller=webhook&action=task&token=superSecretToken&title=mySuperTask" - -# Create a task to another project inside a specific column with the color red -curl "http://myserver/?controller=webhook&action=task&token=superSecretToken&title=task123&project_id=3&column_id=7&color_id=red" -``` - -### Available responses - -- When a task is created successfully, Kanboard return the message "OK" in plain text. -- However if the task creation fail, you will get a "FAILED" message. -- If the token is wrong, you got a "Not Authorized" message and a HTTP status code 401. - -### Available parameters - -Base URL: `http://YOUR_SERVER_HOSTNAME/?controller=webhook&action=task` - -- `token`: Token displayed on the settings page (required) -- `title`: Task title (required) -- `description`: Task description -- `color_id`: Supported colors are yellow, blue, green, purple, red, orange and gray -- `project_id`: Project id (Get the id from the project page) -- `owner_id`: Assignee (Get the user id from the user's page) -- `column_id`: Column on the board (Get the column id from the projects page, mouse over on the column name) - -Only the token and the title parameters are mandatory. The different id can also be found in the database. |