Import Email and attachments

SOLVE
New Contributor

Hi

 

I'm migrating from superoffice to hubspot and need to import emails with their attachments.

Do I upload the attachments to the "/filemanager/api/v2/files" -endpoint with the "hidden" -property set to "true". And then take the id from the response and add under attachments when  creating email in "Engagement"?

Reply
0 Upvotes
1 Accepted solution

Accepted Solutions
Highlighted
HubSpot Moderator

Hey @hubsp 

 

You're absolutely correct! The steps below is the best solution to achieve this as you have outlined:

 

  1. Upload the desired files to your file manager using the CMS Files API.
  2. When successful, the endpoint above will return a file id which you can then use in the next step.
  3. Create EMAIL engagements on the desired contact, company, or deal record with the file id in the attachments array.
  4. If done successfully, this will create email engagements with files attached to them on any contact, company, or deal record timeline.

I hope this helps!

Matthew Willson

HubSpot Developer Support
Reply
0 Upvotes
3 Replies 3
Highlighted
HubSpot Moderator

Hey @hubsp 

 

You're absolutely correct! The steps below is the best solution to achieve this as you have outlined:

 

  1. Upload the desired files to your file manager using the CMS Files API.
  2. When successful, the endpoint above will return a file id which you can then use in the next step.
  3. Create EMAIL engagements on the desired contact, company, or deal record with the file id in the attachments array.
  4. If done successfully, this will create email engagements with files attached to them on any contact, company, or deal record timeline.

I hope this helps!

Matthew Willson

HubSpot Developer Support
Reply
0 Upvotes
Highlighted
New Contributor

There is something I'm doing wrong when uploading a file. I can't open any file except from pdf's and they seems to be corrupted cause I get error when open them.

 

When clicking all file types except pdf it looks like this. 

Capture.PNG

 

Capture.PNG

Capture.PNG

 

 

Reply
0 Upvotes
Highlighted
HubSpot Moderator

Hey @hubsp 

 

I just want to acknowledge your latest query here and can see that my colleague, Wendy is helping out via the thread here: https://community.hubspot.com/t5/APIs-Integrations/Upload-emails-and-attachments/m-p/321951#M31003

Matthew Willson

HubSpot Developer Support
Reply
0 Upvotes