Updating Notes

32 views
Skip to first unread message

ed...@ekoner.com

unread,
Aug 7, 2018, 11:33:28 AM8/7/18
to Capsule API
Is there any way to update a note? I've passed back the note id but it creates a new note.

Example code:


post_headers = {'Content-Type': 'application/json','Accept': 'application/json','Authorization': 'Bearer '+authCode}
new_note_json = {"entry": {"party":{"id":999999999},"type":"note", "id":"999999999", "content":"Note Title - 20/05/2015\nUpdated note content"}}}

response = requests.post(url,headers=post_headers,data=new_note_json)


Daniel Ireson

unread,
Aug 7, 2018, 11:48:33 AM8/7/18
to Capsule API
Hi Edafe,

Yes there is a way to update an existing note using the API, it just looks like you're using the wrong URL.

The URL to create a note is /api/v2/entries but you should use /api/v2/entries/{id} to update notes (where ID is the ID of the note you want to update). Also when updating a note you only need to pass the properties that you'd like to change. So for example to edit the note content you would just need to send:

{ "entry": { "content": "changed" } }

Hope that helps! Let me know if you're still having issues.

Daniel

ed...@ekoner.com

unread,
Aug 7, 2018, 4:02:40 PM8/7/18
to Capsule API
Works perfectly, thank you.
Reply all
Reply to author
Forward
0 new messages