Skip to content

Commit b18ebe8

Browse files
committed
Add documentation for config OCS api
Signed-off-by: Julius Härtl <jus@bitgrid.net>
1 parent 87a7097 commit b18ebe8

2 files changed

Lines changed: 75 additions & 2 deletions

File tree

appinfo/routes.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,6 @@
127127
'ocs' => [
128128
['name' => 'Config#get', 'url' => '/api/v1.0/config', 'verb' => 'GET'],
129129
['name' => 'Config#setValue', 'url' => '/api/v1.0/config/{key}', 'verb' => 'POST'],
130-
['name' => 'Config#setBoardValue', 'url' => '/api/v1.0/config/board/{id}/{key}', 'verb' => 'POST'],
131-
132130

133131
['name' => 'comments_api#list', 'url' => '/api/v1.0/cards/{cardId}/comments', 'verb' => 'GET'],
134132
['name' => 'comments_api#create', 'url' => '/api/v1.0/cards/{cardId}/comments', 'verb' => 'POST'],

docs/API.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ Returns an array of board items
115115
"deletedAt": 0,
116116
"id": 10,
117117
"lastModified": 1586269585,
118+
"settings": {
119+
"notify-due": "off",
120+
"calendar": true
121+
}
118122
}
119123
]
120124
```
@@ -952,6 +956,77 @@ For now only `deck_file` is supported as an attachment type.
952956
The following endpoints are available through the Nextcloud OCS endpoint, which is available at `/ocs/v2.php/apps/deck/api/v1.0/`.
953957
This has the benefit that both the web UI as well as external integrations can use the same API.
954958

959+
## Config
960+
961+
Deck stores user and app configuration values globally and per board. The GET endpoint allows to fetch the current global configuration while board settings will be exposed through the board element on the regular API endpoints.
962+
963+
### GET /api/v1.0/config - Fetch app configuration values
964+
965+
#### Response
966+
967+
| Config key | Description | Value |
968+
| --- | --- |
969+
| calendar | Determines if the calendar/tasks integration through the CalDAV backend is enabled for the user (boolean) |
970+
| groupLimit | Determines if creating new boards is limited to certain groups of the instance. The resulting output is an array of group objects with the id and the displayname (Admin only)|
971+
972+
```
973+
{
974+
"ocs": {
975+
"meta": {
976+
"status": "ok",
977+
"statuscode": 200,
978+
"message": "OK"
979+
},
980+
"data": {
981+
"calendar": true,
982+
"groupLimit": [
983+
{
984+
"id": "admin",
985+
"displayname": "admin"
986+
}
987+
]
988+
}
989+
}
990+
}
991+
992+
```
993+
994+
### POST /api/v1.0/config/{id}/{key} - Set a config value
995+
996+
997+
#### Request parameters
998+
999+
| Parameter | Type | Description |
1000+
| --------- | ------- | --------------------------------------- |
1001+
| id | Integer | The id of the board |
1002+
| key | String | The config key to set, prefixed with `board:{boardId}:` for board specific settings |
1003+
| value | String | The value that should be stored for the config key |
1004+
1005+
##### Board configuration
1006+
1007+
| Key | Value |
1008+
| --- | ----- |
1009+
| notify-due | `off`, `assigned` or `all` |
1010+
| calendar | Boolean |
1011+
1012+
#### Example request
1013+
1014+
```
1015+
curl -X POST 'https://admin:admin@nextcloud.local/ocs/v2.php/apps/deck/api/v1.0/config/calendar' -H 'Accept: application/json' -H "Content-Type: application/json" -H 'OCS-APIRequest: true' --data-raw '{"value":false}'
1016+
1017+
{
1018+
"ocs": {
1019+
"meta": {
1020+
"status": "ok",
1021+
"statuscode": 200,
1022+
"message": "OK"
1023+
},
1024+
"data": false
1025+
}
1026+
}
1027+
1028+
```
1029+
9551030
## Comments
9561031

9571032
### GET /cards/{cardId}/comments - List comments

0 commit comments

Comments
 (0)