diff --git a/src/etapi/etapi.openapi.yaml b/src/etapi/etapi.openapi.yaml index 47e8d22a8..a05f6b3b2 100644 --- a/src/etapi/etapi.openapi.yaml +++ b/src/etapi/etapi.openapi.yaml @@ -228,6 +228,23 @@ paths: application/json: schema: $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: parameters: - name: noteId diff --git a/test-etapi/get-note-content.http b/test-etapi/get-note-content.http new file mode 100644 index 000000000..2f22dabbe --- /dev/null +++ b/test-etapi/get-note-content.http @@ -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 === "

Hi there!

"); +%}