Tips of the Day
We can Upload the Attachment inside the Zoho CRM in a record using API.
File Type:- Any file type like (mp3,jpg,png).
First Get the file and make it a file
- resvp = zoho.crm.getRecordById("Leads", lid);
- attachment_Id = resvp.get("MP3_File").getJSON("attachment_Id");
- downloaddata = invokeurl
- [
- url: "https://www.zohoapis.in/crm/v4/Leads/"+lid+"/actions/download_fields_attachment?fields_attachment_id="+attachment_Id
- type: GET
- connection : "zohocrm"
- ];
- downloaddata.setFileType("mp3");
- For check it’s file or not
- FileType = downloaddata.isFile()
- if(FileType == true)
- {
- Info “it’s a file;
- resvp1 = zoho.crm.attachFile("Leads", lid, downloaddata);
- Info resvp1;
- }
- else
- {
- Info “Not as a file”;
- }