Can't send email with attachment using zoho mail api

Hi,
I would like to send an email with an attachment using zoho mail module but I get errors (400 something wrong).

Do you know which field and value I have to fill to send 1 attachment with zoho module api call ?
Thank you

Arnaud


Details of my previous steps :

As I have already used google email module, I thought I could replace it with zoho mail module but I can’t find “attachment” field in form.


I decide to replace Zoho Mail “Send an email” by “Make an API Call”.

  1. I use a HTTP Module to get the file => OK
  2. I use Zoho API Call module to get id account (/account url) => OK
  3. I use Zoho API Call module to get upload attachment (/messages/attachments url) => KO

I tried different fields and values. No one works.

  • Headers : Content-Type ; multipart/form-data ## QueryString : attachmentUrl;theFileURL
    “The operation failed with an error. [400] Something wrong. Please try again.”
  • Headers : Content-Type ; application/output-stream ## body { “fileName” : file name (from http module) ; “attachment” : data (from http module) }
  • Headers : Content-Type ; application/output-stream ## body { data (from http module) }
    The operation failed with an error. [415] Something wrong. Please try again.

Not very explicit errors :sweat_smile:
I can’t find in documentation the right field I have to fill and the right value I have to input.
I also tried different zoho connection rights parameters (read, create, etc) but I haven’t found any difference

  1. I use Zoho API Call module to send email (/messages url) => OK if I bypass step 3 (no attachment)

Here is the blueprint
send zoho email attachment.json (15.6 KB)

Thanks to postman community, I have found the clue.

  1. use http Module to get the file.
  2. use Zoho API Call module to ge id account (/account call)
  3. use Zoho API Call module to upload attachment (/messages/attachments call) with headers :
    key : Content-Type
    value : application/octet-stream

query parameters
key : fileName
value : [5. file name] (from http module)

Body : [5. data] (from http module)

  1. use Zoho API Call module to send mail (/messages call)
    header
    key : Content-Type
    value : application/json

Body :

{
“fromAddress”: “from@email.com”,
“toAddress”: “dest@email.com”,
“subject”: “test api attach”,
“content”: “body content”,
“attachments”: [
{
“storeName” : “{{7.body.data.storeName}}”,
“attachmentPath” : “{{7.body.data.attachmentPath}}”,
“attachmentName” : “{{7.body.data.attachmentName}}”

  }

]
}

Heya @ad :wave:

so good to see you learning from the community and coming up with solution on your problem!

Keep up the pace! :muscle:

1 Like