mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-27 01:51:34 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			62 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			HTTP
		
	
	
	
	
	
			
		
		
	
	
			62 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			HTTP
		
	
	
	
	
	
| POST {{triliumHost}}/etapi/create-note
 | |
| Authorization: {{authToken}}
 | |
| Content-Type: application/json
 | |
| 
 | |
| {
 | |
|   "parentNoteId": "root",
 | |
|   "title": "GetInheritedAttributes Test Note",
 | |
|   "type": "text",
 | |
|   "content": "Hi there!"
 | |
| }
 | |
| 
 | |
| > {%
 | |
|     client.assert(response.status === 201);
 | |
|     client.global.set("parentNoteId", response.body.note.noteId);
 | |
| %}
 | |
| 
 | |
| ###
 | |
| 
 | |
| POST {{triliumHost}}/etapi/attributes
 | |
| Authorization: {{authToken}}
 | |
| Content-Type: application/json
 | |
| 
 | |
| {
 | |
|   "noteId": "{{parentNoteId}}",
 | |
|   "type": "label",
 | |
|   "name": "mylabel",
 | |
|   "value": "val",
 | |
|   "isInheritable": true
 | |
| }
 | |
| 
 | |
| > {% client.global.set("createdAttributeId", response.body.attributeId); %}
 | |
| 
 | |
| ###
 | |
| 
 | |
| POST {{triliumHost}}/etapi/create-note
 | |
| Authorization: {{authToken}}
 | |
| Content-Type: application/json
 | |
| 
 | |
| {
 | |
|   "parentNoteId": "{{parentNoteId}}",
 | |
|   "title": "Hello",
 | |
|   "type": "text",
 | |
|   "content": "Hi there!"
 | |
| }
 | |
| 
 | |
| > {%
 | |
| client.global.set("createdNoteId", response.body.note.noteId);
 | |
| client.global.set("createdBranchId", response.body.branch.branchId);
 | |
| %}
 | |
| 
 | |
| ###
 | |
| 
 | |
| GET {{triliumHost}}/etapi/notes/{{createdNoteId}}
 | |
| Authorization: {{authToken}}
 | |
| 
 | |
| > {%
 | |
| client.assert(response.status === 200);
 | |
| client.assert(response.body.noteId == client.global.get("createdNoteId"));
 | |
| client.assert(response.body.attributes.length == 1);
 | |
| client.assert(response.body.attributes[0].attributeId == client.global.get("createdAttributeId"));
 | |
| %}
 | 
