@@ -9,12 +9,13 @@ In this document, the Notes API major version 1 and all its minor versions are d
99
1010## Minor versions
1111
12- | API version | Introduced with app version | Remarkable Changes |
13- | :-----------:| :----------------------------| :-------------------|
14- | ** 1.0** | Notes 3.3 (May 2020) | Separate title, no auto rename based on content |
15- | ** 1.1** | Notes 3.4 (May 2020) | Filter "Get all notes" by category |
16- | ** 1.2** | Notes 4.1 (June 2021) | Preventing lost updates, read-only notes, settings |
17- | ** 1.3** | Notes 4.5 (August 2022) | Allow custom file suffixes |
12+ | API version | Introduced with app version | Remarkable Changes |
13+ | :-----------:| :----------------------------| :---------------------------------------------------|
14+ | ** 1.0** | Notes 3.3 (May 2020) | Separate title, no auto rename based on content |
15+ | ** 1.1** | Notes 3.4 (May 2020) | Filter "Get all notes" by category |
16+ | ** 1.2** | Notes 4.1 (June 2021) | Preventing lost updates, read-only notes, settings |
17+ | ** 1.3** | Notes 4.5 (August 2022) | Allow custom file suffixes |
18+ | ** 1.4** | Notes 4.9 (August 2025) | Add external image api |
1819
1920
2021
@@ -136,7 +137,7 @@ Note not found.
136137<details ><summary >Details</summary >
137138
138139#### Request parameters
139- - ** Body** : some or all "read/write" attributes (see section [ Note attributes] ( #note-attributes ) ), example:
140+ - ** Body** : some or all "read/write" attributes (see section [ Note attributes] ( #note-attributes ) ), example:
140141``` js
141142{
142143 " title" : " New note" ,
@@ -278,6 +279,74 @@ No valid authentication credentials supplied.
278279
279280
280281
282+ ### Get attachment (` GET /attachment/{id} ` )
283+ <details ><summary >Details</summary >
284+
285+ * (since API v1.4)*
286+
287+ #### Request parameters
288+ | Parameter | Type | Description |
289+ | :----------| :-----------------------------| :-------------------------------------------|
290+ | ` id ` | integer, required (path) | ID of the note to load the attachment from |
291+ | ` path ` | string, required (request) | Path or name of the attachment to load. |
292+
293+ Example:
294+
295+ ``` bash
296+ curl -u " user:password" " https://yournextcloud.com/index.php/apps/notes/api/v1.4/attachment/<id>?path=<path>" -o < outputfilename> .jpg
297+ ```
298+
299+
300+ #### Response
301+ ##### 200 OK
302+ - ** Body** : Image or File
303+
304+ ##### 400 Bad Request
305+ Endpoint not supported by installed notes app version (requires API version 1.4).
306+
307+ ##### 401 Unauthorized
308+ No valid authentication credentials supplied.
309+ </details >
310+
311+
312+ ### Put attachment (` POST /attachment/{id} ` )
313+ <details ><summary >Details</summary >
314+
315+ * (since API v1.4)*
316+
317+ #### Request parameters
318+ | Parameter | Type | Description |
319+ | :----------| :------------------------| :------------------------------------------------|
320+ | ` id ` | integer, required (path)| ID of the note to upload the attachment to |
321+
322+ Example:
323+
324+ ``` bash
325+ curl -u " user:password" \
326+ -X POST \
327+ -F " file=@/path/to/image.png" \
328+ " https://yournextcloud.com/index.php/apps/notes/api/v1.4/attachment/<id>"
329+
330+ # The post request will return the filename that was generated:
331+ {" filename" :" d8aef2005b4f815fec8ade5388240f2c.png" }
332+ ```
333+
334+ #### Response
335+ ##### 200 OK
336+ - ** Body** : Filename in json encoded:
337+ ``` js
338+ {
339+ " filename" : " image.jpg"
340+ }
341+ ```
342+
343+ ##### 400 Bad Request
344+ Endpoint not supported by installed notes app version (requires API version 1.4).
345+
346+ ##### 401 Unauthorized
347+ No valid authentication credentials supplied.
348+ </details >
349+
281350## Preventing lost updates and conflict solution
282351
283352While changing a note using a Notes client, the same note may be changed by another client.
0 commit comments