Hello everyone!
Welcome back to yet another post in the Kaizen series!
This week, we will discuss the following:
- Notes as related lists
- Attaching files to notes via API
1. Notes as Related Lists
Notes API allows you to manipulate all the notes in all the modules, or specific notes based on their note IDs. Zoho CRM API also allows you to handle notes of a specific record using the related lists API.
The request URL will differ when you read/add/update/delete a note, as a related list. The structure of the URL would be:
To manipulate all the notes of a record: {{api-domain}}/crm/v2/{module_api_name}/{record_id}/Notes
(or)
To manipulate a specific note: {{api-domain}}/crm/v2/{module_api_name}/{record_id}/Notes/{note_id}
Sample Response to add note to a record:
Things of note:
2. Attaching files to notes
You can attach files (images, audio, video, and so on) to notes via API. To attach files, you must first upload them to ZFS, and use the ID received to attach them to notes.
To get and update the attachment details of notes, you can use the Get Notes and Update Notes API respectively. You will get the details in the "$attachments" JSON array where each object in the array represents the unique ID of the attachment.
Specify the ZFS file ID in the "id" key in the "$attachments" JSON array.
"$attachments": [
{
"id": "9943645bd4411e51145e0515bd77e380385aef2ab242da01182fae5958fc3018"
}
]
|
Request URL: {{api-domain}}/crm/v2/Notes/{note_id}/Attachments
Request Method: POST
Add the attachment file in the request body as form-data.
Note:
- You can attach more than one attachment to a note.
- Ensure that size of each attachment file does not exceed 20 MB.
Request URL: {{api-domain}}/crm/v2/Notes/{note_id}/Attachments/{attachment_id}
Request Method: DELETE
Sample Response
Note:
- You can delete only one attachment per API call.
We hope you found this post useful.
Write to us at support@zohocrm.com if you have any questions, or let us know in the comment section.
Cheers!