1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- POST {{triliumHost}}/etapi/create-note
- Authorization: {{authToken}}
- Content-Type: application/json
- {
- "parentNoteId": "root",
- "title": "Hello",
- "type": "text",
- "content": "Hi there!"
- }
- > {%
- client.global.set("createdNoteId", response.body.note.noteId);
- client.global.set("createdBranchId", response.body.branch.branchId);
- %}
- ###
- POST {{triliumHost}}/etapi/attributes
- Authorization: {{authToken}}
- Content-Type: application/json
- {
- "noteId": "{{createdNoteId}}",
- "type": "label",
- "name": "mylabel",
- "value": "val",
- "isInheritable": true
- }
- > {% client.global.set("createdAttributeId", response.body.attributeId); %}
- ###
- PATCH {{triliumHost}}/etapi/attributes/{{createdAttributeId}}
- Authorization: {{authToken}}
- Content-Type: application/json
- {
- "value": "CHANGED"
- }
- ###
- GET {{triliumHost}}/etapi/attributes/{{createdAttributeId}}
- Authorization: {{authToken}}
- > {%
- client.assert(response.body.value === "CHANGED");
- %}
- ###
- PATCH {{triliumHost}}/etapi/attributes/{{createdAttributeId}}
- Authorization: {{authToken}}
- Content-Type: application/json
- {
- "noteId": "root"
- }
- > {%
- client.assert(response.status === 400);
- client.assert(response.body.code == "PROPERTY_NOT_ALLOWED");
- %}
- ###
- PATCH {{triliumHost}}/etapi/attributes/{{createdAttributeId}}
- Authorization: {{authToken}}
- Content-Type: application/json
- {
- "value": null
- }
- > {%
- client.assert(response.status === 400);
- client.assert(response.body.code == "PROPERTY_VALIDATION_ERROR");
- %}
|