patch-branch.http 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. POST {{triliumHost}}/etapi/create-note
  2. Authorization: {{authToken}}
  3. Content-Type: application/json
  4. {
  5. "parentNoteId": "root",
  6. "type": "text",
  7. "title": "Hello",
  8. "content": ""
  9. }
  10. > {% client.global.set("createdBranchId", response.body.branch.branchId); %}
  11. ###
  12. PATCH {{triliumHost}}/etapi/branches/{{createdBranchId}}
  13. Authorization: {{authToken}}
  14. Content-Type: application/json
  15. {
  16. "prefix": "pref",
  17. "notePosition": 666,
  18. "isExpanded": true
  19. }
  20. ###
  21. GET {{triliumHost}}/etapi/branches/{{createdBranchId}}
  22. Authorization: {{authToken}}
  23. > {%
  24. client.assert(response.status === 200);
  25. client.assert(response.body.prefix === 'pref');
  26. client.assert(response.body.notePosition === 666);
  27. client.assert(response.body.isExpanded === true);
  28. %}
  29. ###
  30. PATCH {{triliumHost}}/etapi/branches/{{createdBranchId}}
  31. Authorization: {{authToken}}
  32. Content-Type: application/json
  33. {
  34. "parentNoteId": "root"
  35. }
  36. > {%
  37. client.assert(response.status === 400);
  38. client.assert(response.body.code == "PROPERTY_NOT_ALLOWED");
  39. %}
  40. ###
  41. PATCH {{triliumHost}}/etapi/branches/{{createdBranchId}}
  42. Authorization: {{authToken}}
  43. Content-Type: application/json
  44. {
  45. "prefix": 123
  46. }
  47. > {%
  48. client.assert(response.status === 400);
  49. client.assert(response.body.code == "PROPERTY_VALIDATION_ERROR");
  50. %}