put-attachment-content-binary.http 833 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. POST {{triliumHost}}/etapi/create-note
  2. Authorization: {{authToken}}
  3. Content-Type: application/json
  4. {
  5. "parentNoteId": "root",
  6. "title": "Hello",
  7. "type": "text",
  8. "content": "Hi there!"
  9. }
  10. > {% client.global.set("createdNoteId", response.body.note.noteId); %}
  11. ###
  12. POST {{triliumHost}}/etapi/attachments
  13. Authorization: {{authToken}}
  14. Content-Type: application/json
  15. {
  16. "ownerId": "{{createdNoteId}}",
  17. "role": "file",
  18. "mime": "text/plain",
  19. "title": "my attachment",
  20. "content": "text"
  21. }
  22. > {% client.global.set("createdAttachmentId", response.body.attachmentId); %}
  23. ###
  24. PUT {{triliumHost}}/etapi/attachments/{{createdAttachmentId}}/content
  25. Authorization: {{authToken}}
  26. Content-Type: application/octet-stream
  27. Content-Transfer-Encoding: binary
  28. < ../images/icon-color.png
  29. > {% client.assert(response.status === 204); %}