1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/kanboard_ynh.git synced 2024-09-03 19:36:17 +02:00
kanboard_ynh/sources/doc/api-group-procedures.markdown
2016-01-24 17:50:52 +01:00

2.4 KiB

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:

{
    "jsonrpc": "2.0",
    "method": "createGroup",
    "id": 1416806551,
    "params": [
        "My Group B",
        "1234"
    ]
}

Response example:

{
    "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:

{
    "jsonrpc": "2.0",
    "method": "updateGroup",
    "id": 866078030,
    "params": {
        "group_id": "1",
        "name": "ABC",
        "external_id": "something"
    }
}

Response example:

{
    "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:

{
    "jsonrpc": "2.0",
    "method": "removeGroup",
    "id": 566000661,
    "params": [
        "1"
    ]
}

Response example:

{
    "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:

{
    "jsonrpc": "2.0",
    "method": "getGroup",
    "id": 1968647622,
    "params": [
        "1"
    ]
}

Response example:

{
    "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:

{
    "jsonrpc": "2.0",
    "method": "getAllGroups",
    "id": 546070742
}

Response example:

{
    "jsonrpc": "2.0",
    "id": 546070742,
    "result": [
        {
            "id": "1",
            "external_id": "",
            "name": "My Group A"
        },
        {
            "id": "2",
            "external_id": "1234",
            "name": "My Group B"
        }
    ]
}