Improve webhooks documentation
This commit is contained in:
@@ -198,9 +198,9 @@ function form_checkbox($name, $label, $value, $checked = false, $class = '')
|
|||||||
return '<label><input type="checkbox" name="'.$name.'" class="'.$class.'" value="'.escape($value).'" '.($checked ? 'checked="checked"' : '').'> '.escape($label).'</label>';
|
return '<label><input type="checkbox" name="'.$name.'" class="'.$class.'" value="'.escape($value).'" '.($checked ? 'checked="checked"' : '').'> '.escape($label).'</label>';
|
||||||
}
|
}
|
||||||
|
|
||||||
function form_label($label, $name, $class = '')
|
function form_label($label, $name, array $attributes = array())
|
||||||
{
|
{
|
||||||
return '<label for="form-'.$name.'" class="'.$class.'">'.escape($label).'</label>';
|
return '<label for="form-'.$name.'" '.implode(' ', $attributes).'>'.escape($label).'</label>';
|
||||||
}
|
}
|
||||||
|
|
||||||
function form_textarea($name, $values = array(), array $errors = array(), array $attributes = array(), $class = '')
|
function form_textarea($name, $values = array(), array $errors = array(), array $attributes = array(), $class = '')
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ Webhooks are useful to perform actions from external applications (shell-scripts
|
|||||||
How to create a task with a webhook?
|
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
|
```bash
|
||||||
# Create a task for the default project inside the first column
|
# 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
|
# 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"
|
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.
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<?php foreach ($columns as $column): ?>
|
<?php foreach ($columns as $column): ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?= Helper\form_label(t('Column %d', ++$i), 'title['.$column['id'].']') ?></td>
|
<td><?= Helper\form_label(t('Column %d', ++$i), 'title['.$column['id'].']', array('title="column_id='.$column['id'].'"')) ?></td>
|
||||||
<td><?= Helper\form_text('title['.$column['id'].']', $values, $errors, array('required')) ?></td>
|
<td><?= Helper\form_text('title['.$column['id'].']', $values, $errors, array('required')) ?></td>
|
||||||
<td><?= Helper\form_number('task_limit['.$column['id'].']', $values, $errors, array('placeholder="'.t('limit').'"')) ?></td>
|
<td><?= Helper\form_number('task_limit['.$column['id'].']', $values, $errors, array('placeholder="'.t('limit').'"')) ?></td>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
<?php foreach ($projects as $project): ?>
|
<?php foreach ($projects as $project): ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<a href="?controller=board&action=show&project_id=<?= $project['id'] ?>"><?= Helper\escape($project['name']) ?></a>
|
<a href="?controller=board&action=show&project_id=<?= $project['id'] ?>" title="project_id=<?= $project['id'] ?>"><?= Helper\escape($project['name']) ?></a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?= $project['is_active'] ? t('Active') : t('Inactive') ?>
|
<?= $project['is_active'] ? t('Active') : t('Inactive') ?>
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<?php foreach ($project['columns'] as $column): ?>
|
<?php foreach ($project['columns'] as $column): ?>
|
||||||
<li>
|
<li>
|
||||||
<?= Helper\escape($column['title']) ?> (<?= $column['nb_active_tasks'] ?>)
|
<span title="column_id=<?= $column['id'] ?>"><?= Helper\escape($column['title']) ?></span> (<?= $column['nb_active_tasks'] ?>)
|
||||||
</li>
|
</li>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<?php foreach ($users as $user): ?>
|
<?php foreach ($users as $user): ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<?= Helper\escape($user['username']) ?>
|
<span title="user_id=<?= $user['id'] ?>"><?= Helper\escape($user['username']) ?></span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?= $user['is_admin'] ? t('Yes') : t('No') ?>
|
<?= $user['is_admin'] ? t('Yes') : t('No') ?>
|
||||||
|
|||||||
Reference in New Issue
Block a user