From 5d061594486c0d5761ac80a7548fdb4fdad0619b Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Sat, 3 May 2014 08:46:27 -0400 Subject: Improve webhooks documentation --- core/helper.php | 4 ++-- docs/webhooks.markdown | 24 +++++++++++++++++++++++- templates/board_edit.php | 2 +- templates/project_index.php | 4 ++-- templates/user_index.php | 2 +- 5 files changed, 29 insertions(+), 7 deletions(-) diff --git a/core/helper.php b/core/helper.php index da90bad6..f3c3c3b8 100644 --- a/core/helper.php +++ b/core/helper.php @@ -198,9 +198,9 @@ function form_checkbox($name, $label, $value, $checked = false, $class = '') return ''; } -function form_label($label, $name, $class = '') +function form_label($label, $name, array $attributes = array()) { - return ''; + return ''; } function form_textarea($name, $values = array(), array $errors = array(), array $attributes = array(), $class = '') diff --git a/docs/webhooks.markdown b/docs/webhooks.markdown index bcd38f0f..fb5335f4 100644 --- a/docs/webhooks.markdown +++ b/docs/webhooks.markdown @@ -6,7 +6,7 @@ Webhooks are useful to perform actions from external applications (shell-scripts How to create a task with a webhook? ------------------------------------ -Firstly, you have to get the token from the preferences page. After that, just call this url from anywhere: +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 @@ -15,3 +15,25 @@ curl "http://myserver/?controller=task&action=add&token=superSecretToken&title=m # Create a task to another project inside a specific column with the color red curl "http://myserver/?controller=task&action=add&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 got 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=task&action=add` + +- `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 grey +- `project_id`: Project id (Get the id from the projects page, mouse over on the project title) +- `owner_id`: Assignee (Get the user id from the users page, mouse over on the username) +- `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. diff --git a/templates/board_edit.php b/templates/board_edit.php index 35589bb4..575536a8 100644 --- a/templates/board_edit.php +++ b/templates/board_edit.php @@ -20,7 +20,7 @@ - + diff --git a/templates/project_index.php b/templates/project_index.php index 74d807f6..c7c7d226 100644 --- a/templates/project_index.php +++ b/templates/project_index.php @@ -25,7 +25,7 @@ - + @@ -51,7 +51,7 @@ diff --git a/templates/user_index.php b/templates/user_index.php index ccc955fc..fc15ae44 100644 --- a/templates/user_index.php +++ b/templates/user_index.php @@ -21,7 +21,7 @@ - + -- cgit v1.2.3