mirror of
https://github.com/zadam/trilium.git
synced 2024-11-11 18:08:13 +08:00
Merge pull request #3134 from jph/add-note-content-to-api-spec
Add get note content to ETAPI spec
This commit is contained in:
commit
539eac4be7
2 changed files with 42 additions and 0 deletions
|
@ -228,6 +228,23 @@ paths:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/Error'
|
$ref: '#/components/schemas/Error'
|
||||||
|
/notes/{noteId}/content:
|
||||||
|
parameters:
|
||||||
|
- name: noteId
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/EntityId'
|
||||||
|
get:
|
||||||
|
description: Returns note content idenfied by its ID
|
||||||
|
operationId: getNoteContent
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: note content response
|
||||||
|
content:
|
||||||
|
text/html:
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
/notes/{noteId}/export:
|
/notes/{noteId}/export:
|
||||||
parameters:
|
parameters:
|
||||||
- name: noteId
|
- name: noteId
|
||||||
|
|
25
test-etapi/get-note-content.http
Normal file
25
test-etapi/get-note-content.http
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
POST {{triliumHost}}/etapi/create-note
|
||||||
|
Authorization: {{authToken}}
|
||||||
|
Content-Type: application/json
|
||||||
|
|
||||||
|
{
|
||||||
|
"parentNoteId": "root",
|
||||||
|
"title": "Hello",
|
||||||
|
"type": "text",
|
||||||
|
"content": "Hi there!"
|
||||||
|
}
|
||||||
|
|
||||||
|
> {%
|
||||||
|
client.global.set("createdNoteId", response.body.note.noteId);
|
||||||
|
client.global.set("createdBranchId", response.body.branch.branchId);
|
||||||
|
%}
|
||||||
|
|
||||||
|
###
|
||||||
|
|
||||||
|
GET {{triliumHost}}/etapi/notes/{{createdNoteId}}/content
|
||||||
|
Authorization: {{authToken}}
|
||||||
|
|
||||||
|
> {%
|
||||||
|
client.assert(response.status === 200);
|
||||||
|
client.assert(response.body === "<p>Hi there!</p>");
|
||||||
|
%}
|
Loading…
Reference in a new issue