Email endpoint returns data for some recipients, but not others


I have a list of recipients for a particular campaign. I believe all of them have at least received one email.

Using python and the email events endpoint, I am testing retrieving email event data for the recipients as follows:

Python code:

#...various import statements...

url='[recipient email 123]/profile?hapikey=[my api key]'

f = urllib.request.urlopen(url2)

I am finding that although both [recipient email 123] and [recipient email 456] are in the same campaign recipient list, email recipient will return data while recipient 456 will not. Any clue why that would be? As a new hubspot user, I would expect that qualifying only on the recipient email would return data across all the campaigns that have touched them.

My ultimate goal is to return the list of recipients from the email endpoint by qualifying on the campaignid parameter, but until I can solve the above I won't feel confident that I'm catching all the campaign recipients.

Thanks for any advice!


Hi @ouonomos, happy to help. Taking a look at your request URL, that looks like the search for a contact by email endpoint, not the email events endpoint: Could this be the source of your issue?

If not, can you please respond here with an example URL that you're using with a proper contact email address (exclude api key), and your HubID?


Apologies -- you're right; I'd copied that email address into the wrong URL example
However, I still don't return anything when using the email endpoints URL:

... returns


By contrast,

Does return data.


Hi @ouonomos, it appears you can't make this request for emails with a + character in them. URL encoding doesn't seem to work either. I'm going to reach out to see if this is expected but I do believe it is. Further, make sure to make your requests to the the secure URL rather than http, though that shouldn't have had a bearing on what you saw with the first example you wrote above.


Thanks so much Connor! I'll implement your fixes.