Skip to content

Commit 3611c8f

Browse files
Merge pull request #7159 from Somebodyisnobody/patch-1
Docs: Updating docs for API endpoints for uploading attachments
2 parents da3b857 + 152181f commit 3611c8f

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

docs/API.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The REST API provides access for authenticated users to their data inside the De
66

77
# Prerequisites
88

9-
- All requests require a `OCS-APIRequest` HTTP header to be set to `true` and a `Content-Type` of `application/json`.
9+
- All requests require a `OCS-APIRequest` HTTP header to be set to `true` and a `Content-Type` of `application/json`. This does not apply to the endpoint for uploading attachments, which consumes `multipart/form-data`.
1010
- The API is located at https://nextcloud.local/index.php/apps/deck/api/v1.0
1111
- All request parameters are required, unless otherwise specified
1212

@@ -733,6 +733,7 @@ The board list endpoint supports setting an `If-Modified-Since` header to limit
733733
| Parameter | Type | Description |
734734
| --------- | ------- | --------------------------------------- |
735735
| labelId | Integer | The label id to assign to the card |
736+
736737
#### Response
737738

738739
##### 200 Success
@@ -997,10 +998,12 @@ The request can fail with a bad request response for the following reasons:
997998

998999
#### Request data
9991000

1000-
| Parameter | Type | Description |
1001-
| --------- | ------- | --------------------------------------------- |
1002-
| type | String | The type of the attachement |
1003-
| file | Binary | File data to add as an attachment |
1001+
The request is performed as `multipart/form-data`.
1002+
1003+
| Parameter | Type | Description |
1004+
| --------- | ------- | ----------------------------------------------------------------------------------------------- |
1005+
| type | String | The type of the attachement. Use `file` or `deck_file`. |
1006+
| file | Binary | File data to add as an attachment together with the `filename` parameter according to RFC 7578. |
10041007

10051008
- Prior to Deck version v1.3.0 (API v1.0), attachments were stored within deck. For this type of attachments `deck_file` was used as the default type of attachments
10061009
- Starting with Deck version 1.3.0 (API v1.1) files are stored within the users regular Nextcloud files and the type `file` has been introduced for that
@@ -1022,12 +1025,13 @@ The request can fail with a bad request response for the following reasons:
10221025

10231026
#### Request data
10241027

1025-
| Parameter | Type | Description |
1026-
| --------- | ------- | --------------------------------------------- |
1027-
| type | String | The type of the attachement |
1028-
| file | Binary | File data to add as an attachment |
1028+
The request is performed as `multipart/form-data`.
1029+
1030+
| Parameter | Type | Description |
1031+
| --------- | ------- | ----------------------------------------------------------------------------------------------- |
1032+
| type | String | The type of the attachement. For now only `deck_file` is supported as an attachment type. |
1033+
| file | Binary | File data to add as an attachment together with the `filename` parameter according to RFC 7578. |
10291034

1030-
For now only `deck_file` is supported as an attachment type.
10311035

10321036
#### Response
10331037

0 commit comments

Comments
 (0)