| 
									
										
										
										
											2022-01-07 19:33:59 +01:00
										 |  |  | POST {{triliumHost}}/etapi/create-note | 
					
						
							| 
									
										
										
										
											2022-01-10 17:09:20 +01:00
										 |  |  | Authorization: {{authToken}} | 
					
						
							| 
									
										
										
										
											2022-01-07 19:33:59 +01:00
										 |  |  | 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 | 
					
						
							| 
									
										
										
										
											2022-01-10 17:09:20 +01:00
										 |  |  | Authorization: {{authToken}} | 
					
						
							| 
									
										
										
										
											2022-01-07 19:33:59 +01:00
										 |  |  | Content-Type: application/json | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |   "noteId": "{{createdNoteId}}", | 
					
						
							|  |  |  |   "type": "label", | 
					
						
							|  |  |  |   "name": "mylabel", | 
					
						
							|  |  |  |   "value": "val", | 
					
						
							| 
									
										
										
										
											2022-01-12 19:32:23 +01:00
										 |  |  |   "isInheritable": true | 
					
						
							| 
									
										
										
										
											2022-01-07 19:33:59 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | > {% client.global.set("createdAttributeId", response.body.attributeId); %} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ### | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | GET {{triliumHost}}/etapi/notes/{{createdNoteId}} | 
					
						
							| 
									
										
										
										
											2022-01-10 17:09:20 +01:00
										 |  |  | Authorization: {{authToken}} | 
					
						
							| 
									
										
										
										
											2022-01-07 19:33:59 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-01-12 19:32:23 +01:00
										 |  |  | > {% client.assert(response.status === 200); %} | 
					
						
							| 
									
										
										
										
											2022-01-07 19:33:59 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | ### | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | GET {{triliumHost}}/etapi/branches/{{createdBranchId}} | 
					
						
							| 
									
										
										
										
											2022-01-10 17:09:20 +01:00
										 |  |  | Authorization: {{authToken}} | 
					
						
							| 
									
										
										
										
											2022-01-07 19:33:59 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-01-12 19:32:23 +01:00
										 |  |  | > {% client.assert(response.status === 200); %} | 
					
						
							| 
									
										
										
										
											2022-01-07 19:33:59 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | ### | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | DELETE {{triliumHost}}/etapi/attributes/{{createdAttributeId}} | 
					
						
							| 
									
										
										
										
											2022-01-10 17:09:20 +01:00
										 |  |  | Authorization: {{authToken}} | 
					
						
							| 
									
										
										
										
											2022-01-07 19:33:59 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | > {% client.assert(response.status === 204, "Response status is not 204"); %} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-01-08 12:01:54 +01:00
										 |  |  | ### repeat the DELETE request to test the idempotency | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | DELETE {{triliumHost}}/etapi/attributes/{{createdAttributeId}} | 
					
						
							| 
									
										
										
										
											2022-01-10 17:09:20 +01:00
										 |  |  | Authorization: {{authToken}} | 
					
						
							| 
									
										
										
										
											2022-01-08 12:01:54 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | > {% client.assert(response.status === 204, "Response status is not 204"); %} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-01-07 19:33:59 +01:00
										 |  |  | ### | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | GET {{triliumHost}}/etapi/attributes/{{createdAttributeId}} | 
					
						
							| 
									
										
										
										
											2022-01-10 17:09:20 +01:00
										 |  |  | Authorization: {{authToken}} | 
					
						
							| 
									
										
										
										
											2022-01-07 19:33:59 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-01-08 12:01:54 +01:00
										 |  |  | > {% | 
					
						
							|  |  |  |     client.assert(response.status === 404, "Response status is not 404"); | 
					
						
							|  |  |  |     client.assert(response.body.code === "ATTRIBUTE_NOT_FOUND"); | 
					
						
							|  |  |  | %} |