get-inherited-attribute.http 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. POST {{triliumHost}}/etapi/create-note
  2. Authorization: {{authToken}}
  3. Content-Type: application/json
  4. {
  5. "parentNoteId": "root",
  6. "title": "GetInheritedAttributes Test Note",
  7. "type": "text",
  8. "content": "Hi there!"
  9. }
  10. > {%
  11. client.assert(response.status === 201);
  12. client.global.set("parentNoteId", response.body.note.noteId);
  13. %}
  14. ###
  15. POST {{triliumHost}}/etapi/attributes
  16. Authorization: {{authToken}}
  17. Content-Type: application/json
  18. {
  19. "noteId": "{{parentNoteId}}",
  20. "type": "label",
  21. "name": "mylabel",
  22. "value": "val",
  23. "isInheritable": true
  24. }
  25. > {% client.global.set("createdAttributeId", response.body.attributeId); %}
  26. ###
  27. POST {{triliumHost}}/etapi/create-note
  28. Authorization: {{authToken}}
  29. Content-Type: application/json
  30. {
  31. "parentNoteId": "{{parentNoteId}}",
  32. "title": "Hello",
  33. "type": "text",
  34. "content": "Hi there!"
  35. }
  36. > {%
  37. client.global.set("createdNoteId", response.body.note.noteId);
  38. client.global.set("createdBranchId", response.body.branch.branchId);
  39. %}
  40. ###
  41. GET {{triliumHost}}/etapi/notes/{{createdNoteId}}
  42. Authorization: {{authToken}}
  43. > {%
  44. client.assert(response.status === 200);
  45. client.assert(response.body.noteId == client.global.get("createdNoteId"));
  46. client.assert(response.body.attributes.length == 1);
  47. client.assert(response.body.attributes[0].attributeId == client.global.get("createdAttributeId"));
  48. %}