summaryrefslogtreecommitdiff
path: root/docs/api-json-rpc.markdown
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-07-29 18:45:26 -0400
committerFrederic Guillot <fred@kanboard.net>2015-07-29 18:45:26 -0400
commit2d6b6533acc86747425facc9e96303bcccc6daae (patch)
tree7a17fe198ba916bcaea3fcd73860d2d7610ac1e4 /docs/api-json-rpc.markdown
parentf595fb2786d884dbaf7ec87d53cee920a0655f0e (diff)
Add new api procedures: getDefaultTaskColor(), getDefaultTaskColors() and getColorList()
Diffstat (limited to 'docs/api-json-rpc.markdown')
-rw-r--r--docs/api-json-rpc.markdown185
1 files changed, 184 insertions, 1 deletions
diff --git a/docs/api-json-rpc.markdown b/docs/api-json-rpc.markdown
index 827f4099..ec638529 100644
--- a/docs/api-json-rpc.markdown
+++ b/docs/api-json-rpc.markdown
@@ -40,6 +40,8 @@ Almost the same thing as XML-RPC but with the JSON format.
We use the [version 2 of the protocol](http://www.jsonrpc.org/specification).
You must call the API with a `POST` HTTP request.
+Kanboard support batch requests, so you can make multiple API calls in a single HTTP request. It's particularly useful for mobile clients with higher network latency.
+
Authentication
--------------
@@ -295,6 +297,182 @@ Response example:
}
```
+### getDefaultTaskColors
+
+- Purpose: **Get all default task colors**
+- Parameters: None
+- Result on success: **Color properties**
+
+Request example:
+
+```json
+{
+ "jsonrpc": "2.0",
+ "method": "getDefaultTaskColors",
+ "id": 2108929212
+}
+```
+
+Response example:
+
+```json
+{
+ "jsonrpc": "2.0",
+ "id": 2108929212,
+ "result": {
+ "yellow": {
+ "name": "Yellow",
+ "background": "rgb(245, 247, 196)",
+ "border": "rgb(223, 227, 45)"
+ },
+ "blue": {
+ "name": "Blue",
+ "background": "rgb(219, 235, 255)",
+ "border": "rgb(168, 207, 255)"
+ },
+ "green": {
+ "name": "Green",
+ "background": "rgb(189, 244, 203)",
+ "border": "rgb(74, 227, 113)"
+ },
+ "purple": {
+ "name": "Purple",
+ "background": "rgb(223, 176, 255)",
+ "border": "rgb(205, 133, 254)"
+ },
+ "red": {
+ "name": "Red",
+ "background": "rgb(255, 187, 187)",
+ "border": "rgb(255, 151, 151)"
+ },
+ "orange": {
+ "name": "Orange",
+ "background": "rgb(255, 215, 179)",
+ "border": "rgb(255, 172, 98)"
+ },
+ "grey": {
+ "name": "Grey",
+ "background": "rgb(238, 238, 238)",
+ "border": "rgb(204, 204, 204)"
+ },
+ "brown": {
+ "name": "Brown",
+ "background": "#d7ccc8",
+ "border": "#4e342e"
+ },
+ "deep_orange": {
+ "name": "Deep Orange",
+ "background": "#ffab91",
+ "border": "#e64a19"
+ },
+ "dark_grey": {
+ "name": "Dark Grey",
+ "background": "#cfd8dc",
+ "border": "#455a64"
+ },
+ "pink": {
+ "name": "Pink",
+ "background": "#f48fb1",
+ "border": "#d81b60"
+ },
+ "teal": {
+ "name": "Teal",
+ "background": "#80cbc4",
+ "border": "#00695c"
+ },
+ "cyan": {
+ "name": "Cyan",
+ "background": "#b2ebf2",
+ "border": "#00bcd4"
+ },
+ "lime": {
+ "name": "Lime",
+ "background": "#e6ee9c",
+ "border": "#afb42b"
+ },
+ "light_green": {
+ "name": "Light Green",
+ "background": "#dcedc8",
+ "border": "#689f38"
+ },
+ "amber": {
+ "name": "Amber",
+ "background": "#ffe082",
+ "border": "#ffa000"
+ }
+ }
+}
+```
+
+### getDefaultTaskColor
+
+- Purpose: **Get default task color**
+- Parameters: None
+- Result on success: **color_id**
+
+Request example:
+
+```json
+{
+ "jsonrpc": "2.0",
+ "method": "getDefaultTaskColor",
+ "id": 1144775215
+}
+```
+
+Response example:
+
+```json
+{
+ "jsonrpc": "2.0",
+ "id": 1144775215,
+ "result": "yellow"
+}
+```
+
+### getColorList
+
+- Purpose: **Get the list of task colors**
+- Parameters: none
+- Result on success: **Dictionary of color_id => color_name**
+
+Request example:
+
+```json
+{
+ "jsonrpc": "2.0",
+ "method": "getColorList",
+ "id": 1677051386
+}
+```
+
+Response example:
+
+```json
+{
+ "jsonrpc": "2.0",
+ "id": 1677051386,
+ "result": {
+ "yellow": "Yellow",
+ "blue": "Blue",
+ "green": "Green",
+ "purple": "Purple",
+ "red": "Red",
+ "orange": "Orange",
+ "grey": "Grey",
+ "brown": "Brown",
+ "deep_orange": "Deep Orange",
+ "dark_grey": "Dark Grey",
+ "pink": "Pink",
+ "teal": "Teal",
+ "cyan": "Cyan",
+ "lime": "Lime",
+ "light_green": "Light Green",
+ "amber": "Amber"
+ }
+}
+```
+
### createProject
- Purpose: **Create a new project**
@@ -2045,7 +2223,12 @@ Response example:
"recurrence_basedate": "0",
"recurrence_parent": null,
"recurrence_child": null,
- "url": "http:\/\/127.0.0.1:8000\/?controller=task&action=show&task_id=1&project_id=1"
+ "url": "http:\/\/127.0.0.1:8000\/?controller=task&action=show&task_id=1&project_id=1",
+ "color": {
+ "name": "Yellow",
+ "background": "rgb(245, 247, 196)",
+ "border": "rgb(223, 227, 45)"
+ }
}
}
```