delete-attribute.http 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. > {% client.global.set("createdNoteId", response.body.note.noteId); %}
  11. ###
  12. POST {{triliumHost}}/etapi/attributes
  13. Authorization: {{authToken}}
  14. Content-Type: application/json
  15. {
  16. "noteId": "{{createdNoteId}}",
  17. "type": "label",
  18. "name": "mylabel",
  19. "value": "val",
  20. "isInheritable": true
  21. }
  22. > {% client.global.set("createdAttributeId", response.body.attributeId); %}
  23. ###
  24. DELETE {{triliumHost}}/etapi/attributes/{{createdAttributeId}}
  25. Authorization: {{authToken}}
  26. > {% client.assert(response.status === 204, "Response status is not 204"); %}
  27. ### repeat the DELETE request to test the idempotency
  28. DELETE {{triliumHost}}/etapi/attributes/{{createdAttributeId}}
  29. Authorization: {{authToken}}
  30. > {% client.assert(response.status === 204, "Response status is not 204"); %}
  31. ###
  32. GET {{triliumHost}}/etapi/attributes/{{createdAttributeId}}
  33. Authorization: {{authToken}}
  34. > {%
  35. client.assert(response.status === 404, "Response status is not 404");
  36. client.assert(response.body.code === "ATTRIBUTE_NOT_FOUND");
  37. %}