2022-01-07 19:33:59 +01:00
|
|
|
POST {{triliumHost}}/etapi/create-note
|
2022-01-10 17:09:20 +01:00
|
|
|
Authorization: {{authToken}}
|
2022-01-07 19:33:59 +01:00
|
|
|
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);
|
|
|
|
%}
|
|
|
|
|
|
|
|
### Clone to another location
|
|
|
|
|
|
|
|
POST {{triliumHost}}/etapi/branches
|
2022-01-10 17:09:20 +01:00
|
|
|
Authorization: {{authToken}}
|
2022-01-07 19:33:59 +01:00
|
|
|
Content-Type: application/json
|
|
|
|
|
|
|
|
{
|
|
|
|
"noteId": "{{createdNoteId}}",
|
2022-12-21 16:11:00 +01:00
|
|
|
"parentNoteId": '_hidden'
|
2022-01-07 19:33:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
> {% client.global.set("clonedBranchId", response.body.branchId); %}
|
|
|
|
|
|
|
|
###
|
|
|
|
|
|
|
|
GET {{triliumHost}}/etapi/notes/{{createdNoteId}}
|
2022-01-10 17:09:20 +01:00
|
|
|
Authorization: {{authToken}}
|
2022-01-07 19:33:59 +01:00
|
|
|
|
2022-01-12 19:32:23 +01:00
|
|
|
> {% client.assert(response.status === 200); %}
|
2022-01-07 19:33:59 +01:00
|
|
|
|
|
|
|
###
|
|
|
|
|
|
|
|
GET {{triliumHost}}/etapi/branches/{{createdBranchId}}
|
2022-01-10 17:09:20 +01:00
|
|
|
Authorization: {{authToken}}
|
2022-01-07 19:33:59 +01:00
|
|
|
|
2022-01-12 19:32:23 +01:00
|
|
|
> {% client.assert(response.status === 200); %}
|
2022-01-07 19:33:59 +01:00
|
|
|
|
|
|
|
###
|
|
|
|
|
|
|
|
GET {{triliumHost}}/etapi/branches/{{clonedBranchId}}
|
2022-01-10 17:09:20 +01:00
|
|
|
Authorization: {{authToken}}
|
2022-01-07 19:33:59 +01:00
|
|
|
|
2022-01-12 19:32:23 +01:00
|
|
|
> {% client.assert(response.status === 200); %}
|
2022-01-07 19:33:59 +01:00
|
|
|
|
|
|
|
###
|
|
|
|
|
|
|
|
DELETE {{triliumHost}}/etapi/branches/{{createdBranchId}}
|
2022-01-10 17:09:20 +01:00
|
|
|
Authorization: {{authToken}}
|
2022-01-07 19:33:59 +01:00
|
|
|
|
|
|
|
> {% client.assert(response.status === 204, "Response status is not 204"); %}
|
|
|
|
|
2022-01-08 12:01:54 +01:00
|
|
|
### repeat the DELETE request to test the idempotency
|
|
|
|
|
|
|
|
DELETE {{triliumHost}}/etapi/branches/{{createdBranchId}}
|
2022-01-10 17:09:20 +01:00
|
|
|
Authorization: {{authToken}}
|
2022-01-08 12:01:54 +01:00
|
|
|
|
|
|
|
> {% client.assert(response.status === 204, "Response status is not 204"); %}
|
|
|
|
|
2022-01-07 19:33:59 +01:00
|
|
|
###
|
|
|
|
|
|
|
|
GET {{triliumHost}}/etapi/branches/{{createdBranchId}}
|
2022-01-10 17:09:20 +01:00
|
|
|
Authorization: {{authToken}}
|
2022-01-07 19:33:59 +01:00
|
|
|
|
2022-01-08 12:01:54 +01:00
|
|
|
> {%
|
|
|
|
client.assert(response.status === 404, "Response status is not 404");
|
|
|
|
client.assert(response.body.code === "BRANCH_NOT_FOUND");
|
2022-01-07 19:33:59 +01:00
|
|
|
%}
|
|
|
|
|
|
|
|
###
|
|
|
|
|
|
|
|
GET {{triliumHost}}/etapi/branches/{{clonedBranchId}}
|
2022-01-10 17:09:20 +01:00
|
|
|
Authorization: {{authToken}}
|
2022-01-07 19:33:59 +01:00
|
|
|
|
2022-01-12 19:32:23 +01:00
|
|
|
> {% client.assert(response.status === 200); %}
|
2022-01-07 19:33:59 +01:00
|
|
|
|
|
|
|
###
|
|
|
|
|
|
|
|
GET {{triliumHost}}/etapi/notes/{{createdNoteId}}
|
2022-01-10 17:09:20 +01:00
|
|
|
Authorization: {{authToken}}
|
2022-01-07 19:33:59 +01:00
|
|
|
|
2022-01-12 19:32:23 +01:00
|
|
|
> {% client.assert(response.status === 200); %}
|