<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: who has opened a marketing email via API in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/who-has-opened-a-marketing-email-via-API/m-p/277150#M25280</link>
    <description>&lt;P&gt;Welcome,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/97919"&gt;@juanrobcn11&lt;/a&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, you can use &lt;A href="https://developers.hubspot.com/docs/methods/email/get_events" target="_self"&gt;this endpoint&lt;/A&gt; to retrieve marketing email events for a given recipient with the &lt;CODE&gt;recipient&lt;/CODE&gt;query parameter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you're not sure campaign ID to define as the&amp;nbsp;&lt;CODE&gt;campaignId&lt;/CODE&gt; value, use &lt;A href="https://developers.hubspot.com/docs/methods/email/get_campaigns_by_id" target="_self"&gt;this endpoint&lt;/A&gt; and &lt;A href="https://developers.hubspot.com/docs/methods/email/get_campaign_data" target="_self"&gt;this endpoint&lt;/A&gt; or locate it in the UI on the email's performance page &amp;gt;&amp;nbsp;&lt;STRONG&gt;See details&lt;/STRONG&gt; &amp;gt;&amp;nbsp;&lt;STRONG&gt;Internal HubSpot ID&lt;/STRONG&gt;. See the attached screenshot.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Campaign ID.jpg" style="width: 481px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/18041iB99B42454CF2567D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Campaign ID.jpg" alt="Campaign ID.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 25 Jun 2019 18:33:51 GMT</pubDate>
    <dc:creator>IsaacTakushi</dc:creator>
    <dc:date>2019-06-25T18:33:51Z</dc:date>
    <item>
      <title>who has opened a marketing email via API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/who-has-opened-a-marketing-email-via-API/m-p/276977#M25257</link>
      <description>&lt;P&gt;I would like to know if it is possible to extract the information of who has opened&amp;nbsp;a marketing email and how many times he has opened it via API&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2019 07:49:54 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/who-has-opened-a-marketing-email-via-API/m-p/276977#M25257</guid>
      <dc:creator>juanrobcn11</dc:creator>
      <dc:date>2019-06-25T07:49:54Z</dc:date>
    </item>
    <item>
      <title>Re: who has opened a marketing email via API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/who-has-opened-a-marketing-email-via-API/m-p/277150#M25280</link>
      <description>&lt;P&gt;Welcome,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/97919"&gt;@juanrobcn11&lt;/a&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, you can use &lt;A href="https://developers.hubspot.com/docs/methods/email/get_events" target="_self"&gt;this endpoint&lt;/A&gt; to retrieve marketing email events for a given recipient with the &lt;CODE&gt;recipient&lt;/CODE&gt;query parameter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you're not sure campaign ID to define as the&amp;nbsp;&lt;CODE&gt;campaignId&lt;/CODE&gt; value, use &lt;A href="https://developers.hubspot.com/docs/methods/email/get_campaigns_by_id" target="_self"&gt;this endpoint&lt;/A&gt; and &lt;A href="https://developers.hubspot.com/docs/methods/email/get_campaign_data" target="_self"&gt;this endpoint&lt;/A&gt; or locate it in the UI on the email's performance page &amp;gt;&amp;nbsp;&lt;STRONG&gt;See details&lt;/STRONG&gt; &amp;gt;&amp;nbsp;&lt;STRONG&gt;Internal HubSpot ID&lt;/STRONG&gt;. See the attached screenshot.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Campaign ID.jpg" style="width: 481px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/18041iB99B42454CF2567D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Campaign ID.jpg" alt="Campaign ID.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2019 18:33:51 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/who-has-opened-a-marketing-email-via-API/m-p/277150#M25280</guid>
      <dc:creator>IsaacTakushi</dc:creator>
      <dc:date>2019-06-25T18:33:51Z</dc:date>
    </item>
    <item>
      <title>Re: who has opened a marketing email via API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/who-has-opened-a-marketing-email-via-API/m-p/277398#M25324</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/665"&gt;@IsaacTakushi&lt;/a&gt;&amp;nbsp;and thanks for your answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry, I think I haven't explained correctly my question. I don't know the recipient of the marketing email, so I can't write it in the query as a parameter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I want is to make a query to which I pass a marketing email and it returns who has opened it and how many times each person has opened it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I hope now I have explained myself better.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2019 15:06:51 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/who-has-opened-a-marketing-email-via-API/m-p/277398#M25324</guid>
      <dc:creator>juanrobcn11</dc:creator>
      <dc:date>2019-06-26T15:06:51Z</dc:date>
    </item>
    <item>
      <title>Re: who has opened a marketing email via API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/who-has-opened-a-marketing-email-via-API/m-p/277498#M25335</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/97919"&gt;@juanrobcn11&lt;/a&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for clarifying. Unfortunately, there is no single endpoint that will return that data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instead, you must use multiple endpoints:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Use &lt;A href="https://developers.hubspot.com/docs/methods/cms_email/get-the-statistics-for-a-marketing-email" target="_self"&gt;this endpoint&lt;/A&gt; to get the high level analytics data for a marketing email.&lt;/LI&gt;
&lt;LI&gt;Reference the &lt;CODE&gt;mailingListsIncluded&lt;/CODE&gt; array for the list IDs to which you sent the email.&lt;/LI&gt;
&lt;LI&gt;Use &lt;A href="https://developers.hubspot.com/docs/methods/lists/get_list_contacts" target="_self"&gt;this endpoint&lt;/A&gt;&amp;nbsp;to get the contacts in those lists.&lt;/LI&gt;
&lt;LI&gt;Query the&amp;nbsp;&lt;A href="https://developers.hubspot.com/docs/methods/email/get_events" target="_self"&gt;&lt;EM&gt;Get email events&lt;/EM&gt;&lt;/A&gt; endpoint for those contacts.&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Wed, 26 Jun 2019 22:01:09 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/who-has-opened-a-marketing-email-via-API/m-p/277498#M25335</guid>
      <dc:creator>IsaacTakushi</dc:creator>
      <dc:date>2019-06-26T22:01:09Z</dc:date>
    </item>
    <item>
      <title>Re: who has opened a marketing email via API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/who-has-opened-a-marketing-email-via-API/m-p/277564#M25346</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/665"&gt;@IsaacTakushi&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. When I use the first endpoint, the&amp;nbsp;&lt;SPAN&gt;mailingListsIncluded field returns empty for some emails. Is there any other way to know people who received that email?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2. The query get email events doesn't return a field with the number of times that person has opened the email. How do you know the number?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;3. Additionaly, I want to know also how many clicks has that person done in that email. Is it possible to know it?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2019 09:29:16 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/who-has-opened-a-marketing-email-via-API/m-p/277564#M25346</guid>
      <dc:creator>juanrobcn11</dc:creator>
      <dc:date>2019-06-27T09:29:16Z</dc:date>
    </item>
    <item>
      <title>Re: who has opened a marketing email via API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/who-has-opened-a-marketing-email-via-API/m-p/278505#M25479</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/97919"&gt;@juanrobcn11&lt;/a&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Apologies for the delayed response.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Happy to clarify further:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Could you share the IDs of some marketing emails showing empty&amp;nbsp;&lt;CODE&gt;mailingListsIncluded&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;arrays? Besides the&amp;nbsp;&lt;A href="https://developers.hubspot.com/docs/methods/email/get_events" target="_self"&gt;&lt;EM&gt;Get email events&lt;/EM&gt;&lt;/A&gt; endpoint, I don't know of another way to see recipient emails.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;Correct. The&amp;nbsp;&lt;EM&gt;Get email events&lt;/EM&gt; endpoint returns all email events and doesn't provide meta data on the count of each event &lt;CODE&gt;type&lt;/CODE&gt; (&lt;CODE&gt;SENT&lt;/CODE&gt;, &lt;CODE&gt;OPEN&lt;/CODE&gt;, &lt;CODE&gt;CLICK&lt;/CODE&gt;, etc.). To my knowledge, integrations aggregate and count these events.&lt;/LI&gt;
&lt;LI&gt;Yes. Per item&amp;nbsp;&lt;STRONG&gt;2&lt;/STRONG&gt;, the raw&amp;nbsp;&lt;CODE&gt;CLICK&lt;/CODE&gt; events are returned from the&amp;nbsp;&lt;EM&gt;Get email events&lt;/EM&gt; endpoint, but you must count them on your end.&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Tue, 02 Jul 2019 21:04:19 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/who-has-opened-a-marketing-email-via-API/m-p/278505#M25479</guid>
      <dc:creator>IsaacTakushi</dc:creator>
      <dc:date>2019-07-02T21:04:19Z</dc:date>
    </item>
    <item>
      <title>Re: who has opened a marketing email via API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/who-has-opened-a-marketing-email-via-API/m-p/382357#M37639</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/665"&gt;@IsaacTakushi&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I'm doing something similar: trying to get all stats for all email recipients of a particular marketing email.&amp;nbsp; The "Export" button on the email's performance page provides this information. I would like to pass that data via API to my local app without having to export and upload. I have a few questions, hoping you can assist.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) in one of your answers above, you ref campaignId = Internal Hubspot ID on the email performance page &amp;gt; see details - why do I see different campaignId's for different emails within the same campaign? Does each Internal HubSpot ID = unique identifier for each marketing email regardless of campaign grouping?&lt;/P&gt;&lt;P&gt;2) I was unable to use Internal HubSpot ID for this endpoint: GET /marketing-emails/v1/emails/with-statistics/:email_id -&lt;/P&gt;&lt;P&gt;How would you recommend I get the correct email_id to start this request? I found the email_id via trial and error (in JSON as "id"), but is there an easier way to get this data?&lt;/P&gt;&lt;P&gt;3) To your request to provide some IDs of marketing emails showing empty mailingListsIncluded arrays: HubSpot Internal IDs:&amp;nbsp;&lt;SPAN&gt;98134766,&amp;nbsp;98391486&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Each of these emails was sent to 3 recipients, but the mailingListIncluded array returns an empty array.&amp;nbsp; If the array contained the recipients, I think I can follow the steps you recommended 6/26/2019.&lt;/P&gt;&lt;P&gt;4) Do you have any recommendations on how I might be able to GET the information JSON formatted by the Export button on the email performance page?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;Mulan&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2020 15:36:15 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/who-has-opened-a-marketing-email-via-API/m-p/382357#M37639</guid>
      <dc:creator>Mulan</dc:creator>
      <dc:date>2020-10-28T15:36:15Z</dc:date>
    </item>
    <item>
      <title>Re: who has opened a marketing email via API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/who-has-opened-a-marketing-email-via-API/m-p/382778#M37675</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/141724"&gt;@Mulan&lt;/a&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I will try to lend some insight here. With that said, I am no longer on Developer Support so my responses may be delayed.&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Email "campaigns" actually refer to specific send events. A single marketing email may be sent at different times and thus be associated with more than one email campaign. For example, &lt;A href="https://legacydocs.hubspot.com/docs/methods/cms_email/get-the-statistics-for-a-marketing-email" target="_blank" rel="noopener"&gt;this v1 Marketing Email API endpoint&lt;/A&gt;&amp;nbsp;returns a&amp;nbsp;&lt;CODE&gt;allEmailCampaignIds&lt;/CODE&gt; array. The&amp;nbsp;&lt;STRONG&gt;Internal HubSpot ID&lt;/STRONG&gt; field also lists these&amp;nbsp;&lt;EM&gt;email&amp;nbsp;campaign IDs&lt;/EM&gt; while the ID in the URL is the email ID.&amp;nbsp; These are both distinct from &lt;A href="https://knowledge.hubspot.com/campaigns/create-campaigns" target="_blank" rel="noopener"&gt;&lt;EM&gt;marketing campaigns&lt;/EM&gt;&lt;/A&gt;, which are found under&amp;nbsp;&lt;STRONG&gt;Marketing&lt;/STRONG&gt; &amp;gt;&amp;nbsp;&lt;STRONG&gt;Planning and Strategy&lt;/STRONG&gt; &amp;gt;&lt;STRONG&gt; Campaigns&lt;/STRONG&gt;&amp;nbsp;(It's far too confusing, I know).&lt;/LI&gt;
&lt;LI&gt;Building on the explanation above, that endpoint expects an&amp;nbsp;&lt;EM&gt;email ID&lt;/EM&gt;, which can be found in the email tool's URL or programmatically via&amp;nbsp;&lt;A href="https://legacydocs.hubspot.com/docs/methods/cms_email/get-all-marketing-emails" target="_blank" rel="noopener"&gt;this v1 Marketing Email API endpoint&lt;/A&gt;.&lt;/LI&gt;
&lt;LI&gt;HubSpot email IDs are not unique across all accounts. Which account are you querying?&lt;/LI&gt;
&lt;LI&gt;At this time, it is still not possible to programmatically fetch the same email data available via the&amp;nbsp;&lt;EM&gt;Export&lt;/EM&gt; button. While&amp;nbsp;I don't have any recommendations beyond what has been discussed above,&amp;nbsp;&lt;A href="https://developers.hubspot.com/docs/api/marketing/marketing-emails" target="_blank" rel="noopener"&gt;a newer version of the Marketing Email API&lt;/A&gt; is currently in development and&amp;nbsp;&lt;EM&gt;may&lt;/EM&gt; address some of these use cases.&amp;nbsp;When the new API is released to beta, it will be announced via the &lt;A href="https://developers.hubspot.com/changelog" target="_blank" rel="noopener"&gt;developer changelog&lt;/A&gt;. I recommend subscribing to be notified.&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Thu, 29 Oct 2020 19:20:13 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/who-has-opened-a-marketing-email-via-API/m-p/382778#M37675</guid>
      <dc:creator>IsaacTakushi</dc:creator>
      <dc:date>2020-10-29T19:20:13Z</dc:date>
    </item>
    <item>
      <title>Re: who has opened a marketing email via API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/who-has-opened-a-marketing-email-via-API/m-p/383237#M37727</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;A href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/665" target="_blank" rel="noopener"&gt;@IsaacTakushi&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;Wow, thank you for the answers! Very much appreciated!&lt;/P&gt;&lt;P&gt;1.&amp;nbsp; The marketing campaigns vs the email campaigns now makes more sense (I didn't realize an emailCampaign was a "send event" of the same Marketing email within a Marketing Campaign). Based on your answers, my thought on workflow might start:&lt;/P&gt;&lt;P&gt;- use&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://legacydocs.hubspot.com/docs/methods/cms_email/get-all-marketing-emails" target="_blank" rel="noopener nofollow noopener noreferrer noopener noreferrer"&gt;this v1 Marketing Email API endpoint&lt;/A&gt;&amp;nbsp;to get all the emails ever sent&lt;/P&gt;&lt;P&gt;- user select a specific email for which he/she wants statistics&amp;nbsp;&lt;/P&gt;&lt;P&gt;- use&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://legacydocs.hubspot.com/docs/methods/cms_email/get-the-statistics-for-a-marketing-email" target="_blank" rel="noopener nofollow noopener noreferrer noopener noreferrer"&gt;this v1 Marketing Email API endpoint&lt;/A&gt;&amp;nbsp;to then get the&amp;nbsp;&lt;SPAN&gt;mailingListsIncluded array&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;- use the mailingListsIncluded array in this&amp;nbsp;&lt;A href="https://legacydocs.hubspot.com/docs/methods/lists/get_list_contacts" target="_blank" rel="noopener nofollow noopener noreferrer"&gt;ContactList API endpoint&lt;/A&gt;&amp;nbsp;to get the contactIDs of the contacts to which the marketing email was sent&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;- [after this I am stuck... how do I go from the knowing the contactIDs to getting the status of the marketing email sent to that contact? (e.g. delivered, opened, clicked, etc.)]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2.&amp;nbsp; Regarding the mailingListsIncluded array.&amp;nbsp; Perhaps this array was empty, because the emails to which the Marketing email was sent were not in a specific mailingList, but rather individual email accounts; can you confirm?&amp;nbsp; If so, how would I go about capturing emails that were sent ad hoc and not part of a mailingList?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;3.&amp;nbsp; I just subscribed to the developer changelog. Thank you for the recommendation!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Mulan&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Nov 2020 20:48:00 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/who-has-opened-a-marketing-email-via-API/m-p/383237#M37727</guid>
      <dc:creator>Mulan</dc:creator>
      <dc:date>2020-11-01T20:48:00Z</dc:date>
    </item>
    <item>
      <title>Re: who has opened a marketing email via API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/who-has-opened-a-marketing-email-via-API/m-p/384048#M37835</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/141724"&gt;@Mulan&lt;/a&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Happy to help. Responding in order again:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;The &lt;A href="https://legacydocs.hubspot.com/docs/methods/email/email_events_overview" target="_blank" rel="noopener"&gt;v1 Email Events API&lt;/A&gt; has a&amp;nbsp;&lt;A href="https://legacydocs.hubspot.com/docs/methods/email/get_events" target="_blank" rel="noopener"&gt;&lt;EM&gt;Get email events&lt;/EM&gt;&lt;/A&gt; endpoint (also discussed above) which returns data on marketing email sends, deliveries, opens, and clicks. This endpoint can be filtered by &lt;CODE&gt;recipient&lt;/CODE&gt; (a contact's &lt;CODE&gt;email&lt;/CODE&gt; property value) and &lt;CODE&gt;campaignId&lt;/CODE&gt;, among other fields. Following your proposed workflow, you could grab the contacts' &lt;CODE&gt;email&lt;/CODE&gt; property values and use them to filter requests to the&amp;nbsp;&lt;EM&gt;Get email events&lt;/EM&gt; endpoint by &lt;CODE&gt;recipient&lt;/CODE&gt;.&lt;BR /&gt;&lt;BR /&gt;Alternatively, you might consider grabbing the values &lt;A href="https://legacydocs.hubspot.com/docs/methods/cms_email/get-the-statistics-for-a-marketing-email" target="_blank" rel="noopener"&gt;this endpoint&lt;/A&gt; returns in the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;allEmailCampaignIds&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;array, filtering requests to the&amp;nbsp;&lt;EM&gt;Get email events&lt;/EM&gt; endpoint by&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;campaignId&lt;/CODE&gt;, and looking up contacts by their&amp;nbsp;&lt;CODE&gt;email&lt;/CODE&gt; last. I personally recommend the second approach since contacts may have been added or removed from the list since the email was sent while starting with campaign IDs and the&amp;nbsp;&lt;EM&gt;Get email events&lt;/EM&gt; endpoint will accurately reflect which records were actually sent emails.&lt;/LI&gt;
&lt;LI&gt;My tests support your hypothesis. When marketing emails are sent to individual contact records with the&amp;nbsp;&lt;EM&gt;Send to more&lt;/EM&gt; feature, these contacts are excluded from the&amp;nbsp;&lt;CODE&gt;mailingListsIncluded&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;array since they are not considered members of a list. With that said, my tests also show these one-off contacts are appended to the last email campaign and are visible by filtering the&amp;nbsp;&lt;EM&gt;Get email events&lt;/EM&gt; endpoint &lt;/SPAN&gt;&lt;SPAN&gt;by&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;campaignId&lt;/CODE&gt; (yet another reason to take the second approach above).&lt;/LI&gt;
&lt;LI&gt;You're welcome!&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Please let me know if I can clarify further.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2020 21:17:40 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/who-has-opened-a-marketing-email-via-API/m-p/384048#M37835</guid>
      <dc:creator>IsaacTakushi</dc:creator>
      <dc:date>2020-11-04T21:17:40Z</dc:date>
    </item>
    <item>
      <title>Re: who has opened a marketing email via API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/who-has-opened-a-marketing-email-via-API/m-p/385173#M37986</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/665"&gt;@IsaacTakushi&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Just wanted to follow up and let you know that I got my code working! I went with a slightly modified version of your recommendation above and still need to build in some filtering logic, but all in all I was able to pretty much reproduce all the data that the EXPORT button provides.&amp;nbsp; Thanks so much for sticking with me (even more so given you aren't even working in the HubSpot Support world anymore)!&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I really appreciate you!&lt;/P&gt;&lt;P&gt;Mulan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Nov 2020 02:02:22 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/who-has-opened-a-marketing-email-via-API/m-p/385173#M37986</guid>
      <dc:creator>Mulan</dc:creator>
      <dc:date>2020-11-10T02:02:22Z</dc:date>
    </item>
    <item>
      <title>Re: who has opened a marketing email via API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/who-has-opened-a-marketing-email-via-API/m-p/385308#M38001</link>
      <description>&lt;P&gt;That's fantastic news,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/141724"&gt;@Mulan&lt;/a&gt;! Thanks so much for following up here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Happy to help!&lt;/P&gt;</description>
      <pubDate>Tue, 10 Nov 2020 13:18:00 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/who-has-opened-a-marketing-email-via-API/m-p/385308#M38001</guid>
      <dc:creator>IsaacTakushi</dc:creator>
      <dc:date>2020-11-10T13:18:00Z</dc:date>
    </item>
    <item>
      <title>Re: who has opened a marketing email via API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/who-has-opened-a-marketing-email-via-API/m-p/385429#M38012</link>
      <description>&lt;P&gt;Hi, I have a similar question.&lt;/P&gt;&lt;P&gt;I want to list all the marketing emails, which I could get from &lt;A href="https://legacydocs.hubspot.com/docs/methods/cms_email/get-all-marketing-emails" target="_blank" rel="noopener"&gt;here&lt;/A&gt;&amp;nbsp;and based on selected, marketing email, get the stats for it as well as contacts OPENs.&lt;/P&gt;&lt;P&gt;Then using the "id" I could get the &lt;A href="https://legacydocs.hubspot.com/docs/methods/cms_email/get-the-statistics-for-a-marketing-email" target="_blank" rel="noopener"&gt;Marketing Email data&lt;/A&gt; data and using the&amp;nbsp;"primaryEmailCampaignId" and "portalId" I could get &lt;A href="https://legacydocs.hubspot.com/docs/methods/email/get_events" target="_blank" rel="noopener"&gt;email events&lt;/A&gt; filtered with&amp;nbsp;&lt;SPAN&gt;"eventType=OPEN"&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;for the campaign.&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;And you meantioned that there is no way to get distinct&amp;nbsp;&lt;SPAN&gt;recipients&lt;/SPAN&gt;, as it returns all the events for&amp;nbsp;&lt;SPAN&gt;recipients&lt;/SPAN&gt;. So I'll have to program myself to filter it further? But is there no other way to get distinct contacts because if I have a lot of contacts and they open emails multiple times, that would increase the limit and I'll have to make multiple api calls.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this correct and Is there a better way to do it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Nov 2020 18:28:25 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/who-has-opened-a-marketing-email-via-API/m-p/385429#M38012</guid>
      <dc:creator>haseeb</dc:creator>
      <dc:date>2020-11-10T18:28:25Z</dc:date>
    </item>
    <item>
      <title>Re: who has opened a marketing email via API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/who-has-opened-a-marketing-email-via-API/m-p/385439#M38014</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/150136"&gt;@haseeb&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;1. My first step was the same as your "here" link, getting all marketing emails.&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Based on the selected marketing email and as Isaac suggested, I identified all the associated campaignIds (an array of email events associated with a particular marketing email - there can be multiple campaignIds (email events), as the same marketing email may be sent at different times to different recipients/recipient lists).&amp;nbsp; I learned that from Isaac above.&lt;/P&gt;&lt;P&gt;3.&amp;nbsp; Once I had the campaignIds, I used &lt;A href="https://legacydocs.hubspot.com/docs/methods/email/get_events" target="_blank" rel="noopener"&gt;this&lt;/A&gt; link, using the campaignIds I collected in step 2 (see line 33 of the example code).&amp;nbsp; The response JSON provided me and array of "events" objects including all the "recipients" and their "types" (e.g. DELIVERED, OPEN, etc).&lt;/P&gt;&lt;P&gt;Since you are just looking for those recipients who opened the email, you should be able to filter on "type: OPEN" to get the list of recipients who have opened your marketing email.&amp;nbsp; This approach might be a little simpler/shorter than the approach you suggested.&lt;/P&gt;&lt;P&gt;Good luck!&lt;/P&gt;&lt;P&gt;Mulan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Nov 2020 19:05:46 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/who-has-opened-a-marketing-email-via-API/m-p/385439#M38014</guid>
      <dc:creator>Mulan</dc:creator>
      <dc:date>2020-11-10T19:05:46Z</dc:date>
    </item>
  </channel>
</rss>

