summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEskiso <eSkiSo@users.noreply.github.com>2016-07-30 20:50:18 +0100
committerGitHub <noreply@github.com>2016-07-30 20:50:18 +0100
commited4a71370625158760b420f1780ecae142cd502d (patch)
tree3aa98b5e246c80d639ac9a3a9fb8ec6500ab22c7
parent7009718b17ad75e7097390d7f910ee4cbcba923e (diff)
Updated API Doc for Task Procedure
Added new API calls for task metadata
-rw-r--r--doc/api-task-procedures.markdown138
1 files changed, 138 insertions, 0 deletions
diff --git a/doc/api-task-procedures.markdown b/doc/api-task-procedures.markdown
index 934b1e09..2897c81a 100644
--- a/doc/api-task-procedures.markdown
+++ b/doc/api-task-procedures.markdown
@@ -695,3 +695,141 @@ Response example:
]
}
```
+
+## getTaskMetadata
+
+- Purpose: **Get all metadata related to a task by task unique id**
+- Parameters:
+ - **task_id** (integer, required)
+- Result on success: **list of metadata**
+- Result on failure: **empty array**
+
+Request example to fetch all the metada of a task:
+
+```json
+{
+ "jsonrpc": "2.0",
+ "method": "getTaskMetadata",
+ "id": 133280317,
+ "params": [
+ 1
+ ]
+}
+```
+
+Response example:
+
+```json
+{
+ "jsonrpc": "2.0",
+ "id": 133280317,
+ "result": [
+ {
+ "metaKey1": "metaValue1",
+ "metaKey2": "metaValue2",
+ ...
+ }
+ ]
+}
+```
+
+## getTaskMetadataByName
+
+- Purpose: **Get metadata related to a task by task unique id and metakey (name)**
+- Parameters:
+ - **task_id** (integer, required)
+ - **name** (string, required)
+- Result on success: **metadata value**
+- Result on failure: **empty string**
+
+Request example to fetch metada of a task by name:
+
+```json
+{
+ "jsonrpc": "2.0",
+ "method": "getTaskMetadataByName",
+ "id": 133280317,
+ "params": [
+ 1,
+ "metaKey1"
+ ]
+}
+```
+
+Response example:
+
+```json
+{
+ "jsonrpc": "2.0",
+ "id": 133280317,
+ "result": "metaValue1"
+}
+```
+
+## saveTaskMetadata
+
+- Purpose: **Save/update task metadata**
+- Parameters:
+ - **task_id** (integer, required)
+ - **array("name" => "value")** (array, required)
+- Result on success: **true**
+- Result on failure: **false**
+
+Request example to add/update metada of a task:
+
+```json
+{
+ "jsonrpc": "2.0",
+ "method": "saveTaskMetadata",
+ "id": 133280317,
+ "params": [
+ 1,
+ {
+ "metaName" : "metaValue"
+ }
+ ]
+}
+```
+
+Response example:
+
+```json
+{
+ "jsonrpc": "2.0",
+ "id": 133280317,
+ "result": true
+}
+```
+
+## removeTaskMetadata
+
+- Purpose: **Remove task metadata by name**
+- Parameters:
+ - **task_id** (integer, required)
+ - **name** (string, required)
+- Result on success: **true**
+- Result on failure: **false**
+
+Request example to remove metada of a task by name:
+
+```json
+{
+ "jsonrpc": "2.0",
+ "method": "removeTaskMetadata",
+ "id": 133280317,
+ "params": [
+ 1,
+ "metaKey1"
+ ]
+}
+```
+
+Response example:
+
+```json
+{
+ "jsonrpc": "2.0",
+ "id": 133280317,
+ "result": true
+}
+```