diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-07-31 14:45:06 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-07-31 14:45:06 -0400 |
commit | dc5accae30d225fd0d114055036bfee9b897110c (patch) | |
tree | 5245bf7b840bb79685244f03ba8b5e2d031c49b3 /doc/api-task-procedures.markdown | |
parent | f5abf6c94e1cdf3120fce50eed55076c9caa9e6f (diff) | |
parent | ed4a71370625158760b420f1780ecae142cd502d (diff) |
Merge pull-request #2535
Diffstat (limited to 'doc/api-task-procedures.markdown')
-rw-r--r-- | doc/api-task-procedures.markdown | 138 |
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 +} +``` |