<?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: How to Retrieve All Email Conversations Based on Ticket ID in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/How-to-Retrieve-All-Email-Conversations-Based-on-Ticket-ID/m-p/1051758#M77212</link>
    <description>&lt;P&gt;When I tested the ticket &amp;gt; email association, it returns the email associated with the ticket, but the content seems to be the same each time. What I also need is the response from our team's end for each ticket to provide a complete conversation history.&lt;/P&gt;</description>
    <pubDate>Tue, 08 Oct 2024 15:51:18 GMT</pubDate>
    <dc:creator>MRamatiKroitero</dc:creator>
    <dc:date>2024-10-08T15:51:18Z</dc:date>
    <item>
      <title>How to Retrieve All Email Conversations Based on Ticket ID</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/How-to-Retrieve-All-Email-Conversations-Based-on-Ticket-ID/m-p/1051338#M77185</link>
      <description>&lt;P&gt;Hello!&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I am currently working on a project that involves retrieving all email conversations associated with a specific ticket ID in HubSpot. I am using the HubSpot API, and I have the following function set up to fetch associated conversations:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;def &lt;SPAN class=""&gt;fetch_associated_conversations(&lt;SPAN class=""&gt;ticket_id): &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;batch_input_conversations = BatchInputPublicObjectId(inputs=[{&lt;SPAN class=""&gt;"id": ticket_id}]) associated_conversations_response = hubspot_client.crm.associations.batch_api.read( from_object_type=&lt;SPAN class=""&gt;"ticket", to_object_type=&lt;SPAN class=""&gt;"conversation",&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;batch_input_public_object_id=batch_input_conversations )&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;print(associated_conversations_response)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;BR /&gt;While this function is able to retrieve some data, I want to ensure I am correctly fetching all relevant email conversations tied to the ticket.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Can anyone provide guidance on whether this approach is correct? Are there specific endpoints or parameters I should use to ensure I am capturing all email conversations associated with a ticket?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thank you for your help!&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;BR /&gt;May&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 07 Oct 2024 22:07:56 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/How-to-Retrieve-All-Email-Conversations-Based-on-Ticket-ID/m-p/1051338#M77185</guid>
      <dc:creator>MRamatiKroitero</dc:creator>
      <dc:date>2024-10-07T22:07:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to Retrieve All Email Conversations Based on Ticket ID</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/How-to-Retrieve-All-Email-Conversations-Based-on-Ticket-ID/m-p/1051711#M77210</link>
      <description>&lt;P&gt;Hi, &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/838148"&gt;@MRamatiKroitero&lt;/a&gt;&lt;/SPAN&gt; &lt;span class="lia-unicode-emoji" title=":waving_hand:"&gt;👋&lt;/span&gt; This looks like it's set up well. Have you tested using the ticket &amp;gt; email association? Either in place of ticket &amp;gt; conversations or with your other request? Additionally, have you tested your request using Postman? To see if the number of records returned matches what you are expecting?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hey &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/9629"&gt;@HubDoPete&lt;/a&gt;&lt;/SPAN&gt; &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/513582"&gt;@Shadab_Khan&lt;/a&gt;&lt;/SPAN&gt; &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/101258"&gt;@Teun&lt;/a&gt;, do you have any other suggestions or improvements for &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/838148"&gt;@MRamatiKroitero&lt;/a&gt;&lt;/SPAN&gt;?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for taking a look! — Jaycee&lt;/P&gt;</description>
      <pubDate>Tue, 08 Oct 2024 15:04:55 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/How-to-Retrieve-All-Email-Conversations-Based-on-Ticket-ID/m-p/1051711#M77210</guid>
      <dc:creator>Jaycee_Lewis</dc:creator>
      <dc:date>2024-10-08T15:04:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to Retrieve All Email Conversations Based on Ticket ID</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/How-to-Retrieve-All-Email-Conversations-Based-on-Ticket-ID/m-p/1051758#M77212</link>
      <description>&lt;P&gt;When I tested the ticket &amp;gt; email association, it returns the email associated with the ticket, but the content seems to be the same each time. What I also need is the response from our team's end for each ticket to provide a complete conversation history.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Oct 2024 15:51:18 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/How-to-Retrieve-All-Email-Conversations-Based-on-Ticket-ID/m-p/1051758#M77212</guid>
      <dc:creator>MRamatiKroitero</dc:creator>
      <dc:date>2024-10-08T15:51:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to Retrieve All Email Conversations Based on Ticket ID</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/How-to-Retrieve-All-Email-Conversations-Based-on-Ticket-ID/m-p/1056237#M77462</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/127074"&gt;@Jaycee_Lewis&lt;/a&gt;&amp;nbsp;Thanks for the tag, I was OOO thus late response&lt;/P&gt;
&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/838148"&gt;@MRamatiKroitero&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It looks like you're on the right track with using the HubSpot API to retrieve email conversations tied to a specific ticket. Here’s a more detailed approach that you can take:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;P&gt;&lt;STRONG&gt;Use the Association API (v4)&lt;/STRONG&gt;:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Start by using the &lt;STRONG&gt;latest version (v4)&lt;/STRONG&gt; of the Association API to ensure you're working with the most up-to-date features and capabilities.&lt;/LI&gt;
&lt;LI&gt;Make sure you're dynamically passing in the &lt;STRONG&gt;ticket ID&lt;/STRONG&gt; to fetch the relevant email conversations.&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;&lt;STRONG&gt;Implement a Loop for Email Retrieval&lt;/STRONG&gt;:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;In your code, create a loop function that iterates through each associated email one by one (e.g., email 1, email 2, email 3, etc.).&lt;/LI&gt;
&lt;LI&gt;This ensures you don't run into issues where only a single email is fetched at a time.&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;&lt;STRONG&gt;Use Activity Engagement IDs&lt;/STRONG&gt;:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;To avoid fetching duplicate emails, you can leverage the &lt;STRONG&gt;Activity Engagement ID&lt;/STRONG&gt;. Each logged email in HubSpot has a unique engagement ID.&lt;/LI&gt;
&lt;LI&gt;When retrieving emails, check the engagement ID, and if it matches a previous one, skip that email and move on to the next. This helps ensure you're working with unique emails only.&lt;/LI&gt;
&lt;LI&gt;We used this approach for counting unique emails sent by contacts, but you can apply the same principle to extract the body, subject, and other details of each email.&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;&lt;STRONG&gt;For More Help with Code&lt;/STRONG&gt;:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;If you need specific code snippets (like cURL or Node.js, or Python), I recommend checking out ChatGPT or posting your question in the &lt;A href="https://community.hubspot.com/t5/HubSpot-Developers/ct-p/developers" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;Developers group&lt;/STRONG&gt;&lt;/A&gt; here on the community for more detailed responses from developers.&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Hope this helps! Let me know if you need further clarification.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2024 06:36:38 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/How-to-Retrieve-All-Email-Conversations-Based-on-Ticket-ID/m-p/1056237#M77462</guid>
      <dc:creator>Shadab_Khan</dc:creator>
      <dc:date>2024-10-17T06:36:38Z</dc:date>
    </item>
  </channel>
</rss>

