delete-attribute.http 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. ###
  27. GET {{triliumHost}}/etapi/notes/{{createdNoteId}}
  28. Authorization: {{authToken}}
  29. > {% client.assert(response.status === 200); %}
  30. ###
  31. GET {{triliumHost}}/etapi/branches/{{createdBranchId}}
  32. Authorization: {{authToken}}
  33. > {% client.assert(response.status === 200); %}
  34. ###
  35. DELETE {{triliumHost}}/etapi/attributes/{{createdAttributeId}}
  36. Authorization: {{authToken}}
  37. > {% client.assert(response.status === 204, "Response status is not 204"); %}
  38. ### repeat the DELETE request to test the idempotency
  39. DELETE {{triliumHost}}/etapi/attributes/{{createdAttributeId}}
  40. Authorization: {{authToken}}
  41. > {% client.assert(response.status === 204, "Response status is not 204"); %}
  42. ###
  43. GET {{triliumHost}}/etapi/attributes/{{createdAttributeId}}
  44. Authorization: {{authToken}}
  45. > {%
  46. client.assert(response.status === 404, "Response status is not 404");
  47. client.assert(response.body.code === "ATTRIBUTE_NOT_FOUND");
  48. %}