diff options
author | Gerardo Zamudio <gerardozamudio@users.noreply.github.com> | 2016-02-24 23:48:50 -0600 |
---|---|---|
committer | Gerardo Zamudio <gerardozamudio@users.noreply.github.com> | 2016-02-24 23:48:50 -0600 |
commit | e4de6b3898b64b26d29aff31f21df5fda8055686 (patch) | |
tree | 575f8a65440f291d70a070d168eafca8c82a6459 /doc/api-group-procedures.markdown | |
parent | d9ffbea174ea6524d0a22f8375ca8b3aa04a3c96 (diff) | |
parent | a6540bc604c837d92c9368540c145606723e97f7 (diff) |
Merge pull request #1 from fguillot/master
Update from upstream
Diffstat (limited to 'doc/api-group-procedures.markdown')
-rw-r--r-- | doc/api-group-procedures.markdown | 174 |
1 files changed, 174 insertions, 0 deletions
diff --git a/doc/api-group-procedures.markdown b/doc/api-group-procedures.markdown new file mode 100644 index 00000000..cb11fb96 --- /dev/null +++ b/doc/api-group-procedures.markdown @@ -0,0 +1,174 @@ +Group API Procedures +==================== + +## createGroup + +- Purpose: **Create a new group** +- Parameters: + - **name** (string, required) + - **external_id** (string, optional) +- Result on success: **link_id** +- Result on failure: **false** + +Request example: + +```json +{ + "jsonrpc": "2.0", + "method": "createGroup", + "id": 1416806551, + "params": [ + "My Group B", + "1234" + ] +} +``` + +Response example: + +```json +{ + "jsonrpc": "2.0", + "id": 1416806551, + "result": 2 +} +``` + +## updateGroup + +- Purpose: **Update a group** +- Parameters: + - **group_id** (integer, required) + - **name** (string, optional) + - **external_id** (string, optional) +- Result on success: **true** +- Result on failure: **false** + +Request example: + +```json +{ + "jsonrpc": "2.0", + "method": "updateGroup", + "id": 866078030, + "params": { + "group_id": "1", + "name": "ABC", + "external_id": "something" + } +} +``` + +Response example: + +```json +{ + "jsonrpc": "2.0", + "id": 866078030, + "result": true +} +``` + +## removeGroup + +- Purpose: **Remove a group** +- Parameters: + - **group_id** (integer, required) +- Result on success: **true** +- Result on failure: **false** + +Request example: + +```json +{ + "jsonrpc": "2.0", + "method": "removeGroup", + "id": 566000661, + "params": [ + "1" + ] +} +``` + +Response example: + +```json +{ + "jsonrpc": "2.0", + "id": 566000661, + "result": true +} +``` + +## getGroup + +- Purpose: **Get one group** +- Parameters: + - **group_id** (integer, required) +- Result on success: **Group dictionary** +- Result on failure: **false** + +Request example: + +```json +{ + "jsonrpc": "2.0", + "method": "getGroup", + "id": 1968647622, + "params": [ + "1" + ] +} +``` + +Response example: + +```json +{ + "jsonrpc": "2.0", + "id": 1968647622, + "result": { + "id": "1", + "external_id": "", + "name": "My Group A" + } +} +``` + +## getAllGroups + +- Purpose: **Get all groups** +- Parameters: none +- Result on success: **list of groups** +- Result on failure: **false** + +Request example: + +```json +{ + "jsonrpc": "2.0", + "method": "getAllGroups", + "id": 546070742 +} +``` + +Response example: + +```json +{ + "jsonrpc": "2.0", + "id": 546070742, + "result": [ + { + "id": "1", + "external_id": "", + "name": "My Group A" + }, + { + "id": "2", + "external_id": "1234", + "name": "My Group B" + } + ] +} +``` |