diff options
author | Frédéric Guillot <fred@kanboard.net> | 2014-09-11 18:28:17 +0200 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2014-09-11 18:28:17 +0200 |
commit | 61927232aeeea277344262aa5c92cd9fbedce854 (patch) | |
tree | a79bc0e22281535d0b95390407a1402c742b56c9 /docs | |
parent | d9850ae66ac7c6545633b3cfa0fe1b811b27bc41 (diff) |
Improve API calls for categories
Diffstat (limited to 'docs')
-rw-r--r-- | docs/api-json-rpc.markdown | 143 |
1 files changed, 138 insertions, 5 deletions
diff --git a/docs/api-json-rpc.markdown b/docs/api-json-rpc.markdown index 9f4240dc..3e35290b 100644 --- a/docs/api-json-rpc.markdown +++ b/docs/api-json-rpc.markdown @@ -889,39 +889,172 @@ Response example: ### createCategory - Purpose: **Create a new category** -- Parameters: Key/value pair composed of the **name** (string), **project_id** (integer) +- Parameters: +- **project_id** (integer, required) + - **name** (string, required, must unique for the given project) - Result on success: **true** - Result on failure: **false** +Request example: + +```json +{ + "jsonrpc": "2.0", + "method": "createCategory", + "id": 541909890, + "params": { + "name": "Super category", + "project_id": 1 + } +} +``` + +Response example: + +```json +{ + "jsonrpc": "2.0", + "id": 541909890, + "result": true +} +``` + ### getCategory - Purpose: **Get category information** -- Parameters: **category_id** (integer) +- Parameters: + - **category_id** (integer, required) - Result on success: **category properties** - Result on failure: **null** +Request example: + +```json +{ + "jsonrpc": "2.0", + "method": "getCategory", + "id": 203539163, + "params": { + "category_id": 1 + } +} +``` + +Response example: + +```json +{ + + "jsonrpc": "2.0", + "id": 203539163, + "result": { + "id": "1", + "name": "Super category", + "project_id": "1" + } +} +``` + ### getAllCategories - Purpose: **Get all available categories** -- Parameters: **project_id** (integer) +- Parameters: + - **project_id** (integer, required) - Result on success: **List of categories** - Result on failure: **false** +Request example: + +```json +{ + "jsonrpc": "2.0", + "method": "getAllCategories", + "id": 1261777968, + "params": { + "project_id": 1 + } +} +``` + +Response example: + +```json + + "jsonrpc": "2.0", + "id": 1261777968, + "result": [ + { + "id": "1", + "name": "Super category", + "project_id": "1" + } + ] +} +``` + ### updateCategory - Purpose: **Update a category** -- Parameters: Key/value pair composed of the **id** (integer), **name** (string), **project_id** (integer) +- Parameters: + - **id** (integer, required) + - **name** (string, required) - Result on success: **true** - Result on failure: **false** +Request example: + +```json +{ + "jsonrpc": "2.0", + "method": "updateCategory", + "id": 570195391, + "params": { + "id": 1, + "name": "Renamed category" + } +} +``` + +Response example: + +```json +{ + "jsonrpc": "2.0", + "id": 570195391, + "result": true +} +``` + ### removeCategory - Purpose: **Remove a category** -- Parameters: **category_id** (integer) +- Parameters: + - **category_id** (integer) - Result on success: **true** - Result on failure: **false** +Request example: + +```json +{ + "jsonrpc": "2.0", + "method": "removeCategory", + "id": 88225706, + "params": { + "category_id": 1 + } +} +``` + +Response example: +```json +{ + "jsonrpc": "2.0", + "id": 88225706, + "result": true +} +``` ### createComment |