APIs & Integrations

mthomas
Participant

How can I search for a specific Email and gets its results via the API?

I need to query an email's events via the API. 

 

Looking at your Events documentation, and the rest of the docs, I don't see any way to retrieve the results of a single email

https://developers.hubspot.com/docs/methods/email/get_events

Can I search by email name? Can I query the events by email ID? 

 

We are trying to essentially get a list of everyone who received a specific email and want to import these results into our own system. Surely there has to be a way to query the events of a specific Email ID.

 

Thanks

0 Upvotes
7 Replies 7
cbarley
HubSpot Alumni
HubSpot Alumni

How can I search for a specific Email and gets its results via the API?

Hi @mthomas , campaign IDs directly correlate to the internal email IDs in HubSpot:

http://prntscr.com/myfua7

 

To get email data you can get all campaign IDs then query this endpoint to get the details about each email. There's unfortunately no "search by id" functionality with the email events api. 

mthomas
Participant

How can I search for a specific Email and gets its results via the API?

Thanks for the reponse, that all makes sense. However, how do I get the Campaign ID for a specific campaign I am looking at in the portal? I can get all campaign IDs with your linked query, but that doesn't return any useful information about those campaigns. Just ID, App ID, and App Name, none of which tell me what that campaign is called. I haven't been able to find the Campaign ID of a specific campaign in the portal either. 

0 Upvotes
cbarley
HubSpot Alumni
HubSpot Alumni

How can I search for a specific Email and gets its results via the API?

Hi @mthomas , if you're trying to do this all programmatically you can either make the GET call to get all campaignIds, and then make the subsequent GET to each campaign whcih will provide the name. You can do some filtering on your servers from there, but obviously this is a bit call-intensive. If you're just looking for a specific campaign, I've attached a screenvideo of how to get there. 

 

get campaign ID.gif

0 Upvotes
mthomas
Participant

How can I search for a specific Email and gets its results via the API?

Well that's the way to get a specific email ID. I need to get the ID for an entire campaign of emails. Any way to do that without querying all of them individually and looking for a name?

0 Upvotes
cbarley
HubSpot Alumni
HubSpot Alumni

How can I search for a specific Email and gets its results via the API?

Hi @mthomas , unfortunately not at this time. If you're inclined, I'd suggest posting in the ideas forum so that product can get eyes on your idea.

0 Upvotes
HotDocShaun
Member

How can I search for a specific Email and gets its results via the API?

Hey @cbarley , how about emails that aren't a part of a campaign, is there an endpoint for getting all of those ids, and related analytics?

0 Upvotes
subrahmanyak
Member

How can I search for a specific Email and gets its results via the API?

How about a case where a single campaign has multiple emails sent?  how do we know which email the events belong to?

0 Upvotes