Download Email Attachments

Purpose

To download the attachments of an email.

Request Details

Request URL

{api-domain}/crm/{version}/{module_api_name}/{record_id}/Emails/actions/download_attachments

Supported modules

Leads, Accounts, Contacts, Deals, Quotes, Invoices, Sales Orders, Purchase Orders, and Custom

Header

Authorization: Zoho-oauthtoken 100xx.92d4xxxxxxxxxxxxx15f52

Scope

scope=ZohoCRM.modules.READ
or
scope=ZohoCRM.modules.{module_name}.READ
and
scope=ZohoCRM.modules.emails.READ

Possible Module Names

leads, accounts, contacts, deals, quotes, invoices, salesorders, purchaseorders, and custom

Parameters

Note that when you do not specify the attachment ID and name parameters, all the attachments of that email will be downloaded as a ZIP file.

  • message_idmandatory

    The message ID you get in the response when you send an email. Refer to the "message_id" key in the response of Send Mail API or Get Emails of a Record API to get the message ID.

  • user_idmandatory

    The unique ID of the record owner whose email you want to retrieve. Use the Get Users API to get the user's ID.

  • idmandatory

    The unique ID of the attachment you want to download. Refer to the id key in the attachments array of the Get Emails of a record API.

  • namemandatory

    The name of the attachment in the response of Get Emails of a record API.

Possible Errors

  • MANDATORY_NOT_FOUNDHTTP 400

    You have not specified one or more mandatory parameters.
    Resolution: Refer to the "details" key in the response to find out the missing parameter.

Sample Request

Copiedcurl "https://www.zylkercorp.zohoplatform.com/crm/v4/Leads/3652397000002379001/Emails/actions/download_attachments?message_id=2cceafxxx7c9d&user_id=3652397000000186017&id=72daxxxx1ce66&name=email_templates.png"
-X GET
-H "Authorization: Zoho-oauthtoken 100xx.d92d4xxxxxxxxxxxxx15f52"