APIs & Integrations

israelj
Membro

Pull emails/contacts sent per company

Which API do I need to look into that will allow me to pull the number of emails we sent to a company (aggregate of all employees) over a specific time frame?  

 

i.e. We sent 356 emails to your company this month.

0 Avaliação positiva
2 Respostas 2
FSchulte
Membro

Pull emails/contacts sent per company

Hi! Has there been any changes to the API in this regard? As I understand it the alternativ solution that Wendy proposes only takes in account the emails that are sent via markering, or do I missunderstand? That is, it will not account for the personal correspondense between someone from our sales team and a customer. In a lot of businesses mass marketing is not the way to go, so is there a way to get email per customer and per representativ of our company? Best regards!

0 Avaliação positiva
WendyGoh
HubSpot Employee
HubSpot Employee

Pull emails/contacts sent per company

Hi @israelj,

 

I hope all is well with you 😄

 

While there currently isn't an easy way to pull the total number of emails sent to a particular company over a specific time frame, I do have something in mind which require using more than one endpoint here:

  • You'll first need to loop through the Get all marketing emails statistics API; from the result you can gather the list/contact used on that particular marketing email
    • If you're sending to one or multiple recipients without using list, you can look into the vids_included property to retrieve the contacts this marketing email was sent to
    • If you're using one or more list to sent the marketing email, you can look into the mailingListsIncluded property to retrieve the contact list used on this marketing email
  • Once you've the list of contacts > You can use this endpoint Get associations for CRM object to get the company that is being associated to the contact (Using a definition ID of 1 - Association definitions)
    • You can set a counter and increase the counter for each time the company record vid appears in the results

Hope this helps!

0 Avaliação positiva