trilium/test-etapi/create-note.http
2022-01-04 23:00:59 +01:00

40 lines
881 B
HTTP

POST {{triliumHost}}/etapi/notes
Content-Type: application/json
{
"parentNoteId": "root",
"title": "Hello",
"type": "text",
"content": "Hi there!"
}
> {%
client.test("Request executed successfully", function() {
client.assert(response.status === 200, "Response status is not 200");
});
client.global.set("createdNoteId", response.body.note.noteId);
client.global.set("createdBranchId", response.body.note.branchId);
%}
###
POST {{triliumHost}}/etapi/attributes
Content-Type: application/json
{
"noteId": "{{createdNoteId}}",
"type": "label",
"name": "mylabel",
"value": "val",
"isInheritable": "true"
}
> {%
client.test("Request executed successfully", function() {
client.assert(response.status === 200, "Response status is not 200");
});
client.global.set("createdAttributeId", response.body.attributeId);
%}