summaryrefslogtreecommitdiff
path: root/doc/api-category-procedures.markdown
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-12-05 20:31:27 -0500
committerFrederic Guillot <fred@kanboard.net>2015-12-05 20:31:27 -0500
commite9fedf3e5cd63aea4da7a71f6647ee427c62fa49 (patch)
treeabc2de5aebace4a2d7c94805552264dab6b10bc7 /doc/api-category-procedures.markdown
parent346b8312e5ac877ce3192c2db3a26b500018bbb5 (diff)
Rewrite of the authentication and authorization system
Diffstat (limited to 'doc/api-category-procedures.markdown')
-rw-r--r--doc/api-category-procedures.markdown172
1 files changed, 172 insertions, 0 deletions
diff --git a/doc/api-category-procedures.markdown b/doc/api-category-procedures.markdown
new file mode 100644
index 00000000..6a762009
--- /dev/null
+++ b/doc/api-category-procedures.markdown
@@ -0,0 +1,172 @@
+API Category Procedures
+=======================
+
+### createCategory
+
+- Purpose: **Create a new category**
+- Parameters:
+- **project_id** (integer, required)
+ - **name** (string, required, must be unique for the given project)
+- Result on success: **category_id**
+- 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": 4
+}
+```
+
+### getCategory
+
+- Purpose: **Get category information**
+- 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, 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:
+ - **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)
+- 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
+}
+```