delete-note-with-all-branches.http 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. POST {{triliumHost}}/etapi/create-note
  2. Authorization: {{authToken}}
  3. Content-Type: application/json
  4. {
  5. "parentNoteId": "root",
  6. "title": "Hello",
  7. "type": "text",
  8. "content": "Hi there!"
  9. }
  10. > {%
  11. client.global.set("createdNoteId", response.body.note.noteId);
  12. client.global.set("createdBranchId", response.body.branch.branchId);
  13. %}
  14. ###
  15. POST {{triliumHost}}/etapi/attributes
  16. Authorization: {{authToken}}
  17. Content-Type: application/json
  18. {
  19. "noteId": "{{createdNoteId}}",
  20. "type": "label",
  21. "name": "mylabel",
  22. "value": "val",
  23. "isInheritable": true
  24. }
  25. > {% client.global.set("createdAttributeId", response.body.attributeId); %}
  26. ### Clone to another location
  27. POST {{triliumHost}}/etapi/branches
  28. Authorization: {{authToken}}
  29. Content-Type: application/json
  30. {
  31. "noteId": "{{createdNoteId}}",
  32. "parentNoteId": "_hidden"
  33. }
  34. > {% client.global.set("clonedBranchId", response.body.branchId); %}
  35. ###
  36. GET {{triliumHost}}/etapi/notes/{{createdNoteId}}
  37. Authorization: {{authToken}}
  38. > {% client.assert(response.status === 200); %}
  39. ###
  40. GET {{triliumHost}}/etapi/branches/{{createdBranchId}}
  41. Authorization: {{authToken}}
  42. > {% client.assert(response.status === 200); %}
  43. ###
  44. GET {{triliumHost}}/etapi/branches/{{clonedBranchId}}
  45. Authorization: {{authToken}}
  46. > {% client.assert(response.status === 200); %}
  47. ###
  48. GET {{triliumHost}}/etapi/attributes/{{createdAttributeId}}
  49. Authorization: {{authToken}}
  50. > {% client.assert(response.status === 200); %}
  51. ###
  52. DELETE {{triliumHost}}/etapi/notes/{{createdNoteId}}
  53. Authorization: {{authToken}}
  54. > {% client.assert(response.status === 204, "Response status is not 204"); %}
  55. ### repeat the DELETE request to test the idempotency
  56. DELETE {{triliumHost}}/etapi/notes/{{createdNoteId}}
  57. Authorization: {{authToken}}
  58. > {% client.assert(response.status === 204, "Response status is not 204"); %}
  59. ###
  60. GET {{triliumHost}}/etapi/branches/{{createdBranchId}}
  61. Authorization: {{authToken}}
  62. > {%
  63. client.assert(response.status === 404, "Response status is not 404");
  64. client.assert(response.body.code === "BRANCH_NOT_FOUND");
  65. %}
  66. ###
  67. GET {{triliumHost}}/etapi/branches/{{clonedBranchId}}
  68. Authorization: {{authToken}}
  69. > {%
  70. client.assert(response.status === 404, "Response status is not 404");
  71. client.assert(response.body.code == "BRANCH_NOT_FOUND");
  72. %}
  73. ###
  74. GET {{triliumHost}}/etapi/notes/{{createdNoteId}}
  75. Authorization: {{authToken}}
  76. > {%
  77. client.assert(response.status === 404, "Response status is not 404");
  78. client.assert(response.body.code === "NOTE_NOT_FOUND");
  79. %}
  80. ###
  81. GET {{triliumHost}}/etapi/attributes/{{createdAttributeId}}
  82. Authorization: {{authToken}}
  83. > {%
  84. client.assert(response.status === 404, "Response status is not 404");
  85. client.assert(response.body.code === "ATTRIBUTE_NOT_FOUND");
  86. %}