Attaching files to records directly from your desktop to a record in your CRM is easy. But then, what happens if you want to attach files from an external service? Let's say - you have connected your CRM account with an Invoicing Application using our Developer API. You want to attach all invoices to corresponding records in your CRM account.
Our Developer API now has methods that let you do this.
uploadFile Method
The
uploadFile method lets you attach files to records.
When files are uploaded, they will be shown under the 'Attachments' section in the record details page. Files can be attached to all modules, except Reports, Dashboards and Forecasts.
You can also download or delete files attached to records. The corresponding methods are:
The downloadFile method asks for the ID of the attachment that has to downloaded. You can use the getRelatedRecords Method to get this ID. Here's a sample of how it works:
Say I want to get download a file that is attached to a contact in my CRM account. To do so, here're the steps I would follow:
Step 1: Use the getRelatedRecords Method to get the ID of the file that I want to download.
Here, 508020000000957321 is the ID of the Contact from which I want to download the attachment. This is the response I would receive:
<response uri="/crm/private/xml/Attachments/getRelatedRecords">
<result>
<Attachments>
<row no="1">
<FL val="id">5080200000005483628</FL>
<FL val="File Name">
<![CDATA[ requirements.docx ]]>
</FL>
<FL val="Size">
<![CDATA[ 175662 bytes ]]>
</FL>
<FL val="Modified Time">
<![CDATA[ 2012-07-03 14:58:36 ]]>
</FL>
<FL val="SMOWNERID">508020000000065849</FL>
<FL val="Attached By">
<![CDATA[ charles stone]]>
</FL>
</row>
</Attachments>
</result>
</response>
Step 2: Now, I can download the file using the downloadFile Method.
Request URL:
The attachment will be downloaded.
Photos:
Just like files, we also have new Methods that let you upload, download or delete photos to Leads and Contacts.
These are the methods:
Do try these new methods in your programs and let us know your feedback. Also, we would love to know the various scenarios in which you found the above methods useful.
Thanks and Regards,
Sharanya R
The Zoho CRM Team