<?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: Add timeline activity to new deals in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Add-timeline-activity-to-new-deals/m-p/834036#M66428</link>
    <description>&lt;P&gt;Glad to hear you got it working&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/613902"&gt;@DBurke3&lt;/a&gt;&amp;nbsp;and thanks for sharing the code above!&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 14 Aug 2023 10:02:19 GMT</pubDate>
    <dc:creator>coldrickjack</dc:creator>
    <dc:date>2023-08-14T10:02:19Z</dc:date>
    <item>
      <title>Add timeline activity to new deals</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Add-timeline-activity-to-new-deals/m-p/833076#M66378</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;One of the options that is available to users in Hubspot when they create a new deal via the UI is to add timeline activity to a deal from associated Contacts and Companies:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DBurke3_0-1691747620288.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/96709i2606282134A4D524/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DBurke3_0-1691747620288.png" alt="DBurke3_0-1691747620288.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;However, I’m struggling to see a corresponding option when creating a deal via the API. What my current logic does is this:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;UL&gt;&lt;LI&gt;Create the deal via the API&lt;/LI&gt;&lt;LI&gt;Associate the created deal with my company in Hubspot&lt;/LI&gt;&lt;LI&gt;Iterate over all contacts on the company and associate each contact with the deal&lt;/LI&gt;&lt;/UL&gt;&lt;/DIV&gt;&lt;DIV&gt;The option to include timeline activity does not seem to exist when creating this association, like it does in the UI above. Does anyone know how I can add that timeline activity via the API?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks,&lt;/DIV&gt;&lt;DIV&gt;Darren&lt;/DIV&gt;</description>
      <pubDate>Fri, 11 Aug 2023 09:55:36 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Add-timeline-activity-to-new-deals/m-p/833076#M66378</guid>
      <dc:creator>DBurke3</dc:creator>
      <dc:date>2023-08-11T09:55:36Z</dc:date>
    </item>
    <item>
      <title>Re: Add timeline activity to new deals</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Add-timeline-activity-to-new-deals/m-p/833100#M66382</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/613902"&gt;@DBurke3&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are doing this via the API the process is a little bit more invovled unfortunately. What you need to do is use the CRM Engagement Endpoints to retrieve all of the "Notes", "Meetings" , "Tasks" and "Emails" from the contact record and then update the associations of those objects to reflect on the Deal in question.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Aug 2023 10:18:12 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Add-timeline-activity-to-new-deals/m-p/833100#M66382</guid>
      <dc:creator>coldrickjack</dc:creator>
      <dc:date>2023-08-11T10:18:12Z</dc:date>
    </item>
    <item>
      <title>Re: Add timeline activity to new deals</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Add-timeline-activity-to-new-deals/m-p/833103#M66383</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/426475"&gt;@coldrickjack&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the very quick reply and suggested solution!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me give that a go and see if I can come up with a nice implementation to do that.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;/P&gt;&lt;P&gt;Darren&lt;/P&gt;</description>
      <pubDate>Fri, 11 Aug 2023 10:23:59 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Add-timeline-activity-to-new-deals/m-p/833103#M66383</guid>
      <dc:creator>DBurke3</dc:creator>
      <dc:date>2023-08-11T10:23:59Z</dc:date>
    </item>
    <item>
      <title>Re: Add timeline activity to new deals</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Add-timeline-activity-to-new-deals/m-p/833995#M66419</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/426475"&gt;@coldrickjack&lt;/a&gt;&amp;nbsp;for the suggestion which worked. For the benefit of others, here's the implementation that worked for me:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;def&lt;/SPAN&gt; &lt;SPAN&gt;associate_deal_to_hs_engagements&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;self&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;hubspot_company_id&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;str&lt;/SPAN&gt;&lt;SPAN&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;   # first associate any engagements from the company&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;   self&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;associate_engagements_to_deal&lt;/SPAN&gt;&lt;SPAN&gt;(hubspot_&lt;/SPAN&gt;&lt;SPAN&gt;client&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;engagements&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;get_associated&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"COMPANY"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;hubspot_company_id&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;   # now associate any engagements for the contacts&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;   contact_ids&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;hubspot_&lt;/SPAN&gt;&lt;SPAN&gt;client&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;crm_associations&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;get_company_to_contacts&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;hubspot_company_id&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;   for&lt;/SPAN&gt; &lt;SPAN&gt;contact_id&lt;/SPAN&gt; &lt;SPAN&gt;in&lt;/SPAN&gt; &lt;SPAN&gt;contact_ids&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;      self&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;associate_engagements_to_deal&lt;/SPAN&gt;&lt;SPAN&gt;(hubspot_client&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;engagements&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;get_associated&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"CONTACT"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;contact_id&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;def&lt;/SPAN&gt; &lt;SPAN&gt;associate_engagements_to_deal&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;self&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;engagements&lt;/SPAN&gt;&lt;SPAN&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;   for&lt;/SPAN&gt; &lt;SPAN&gt;engagement&lt;/SPAN&gt; &lt;SPAN&gt;in&lt;/SPAN&gt; &lt;SPAN&gt;engagements&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;   hubspot_client&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;crm_associations&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;create&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;engagement&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;"engagement"&lt;/SPAN&gt;&lt;SPAN&gt;][&lt;/SPAN&gt;&lt;SPAN&gt;"id"&lt;/SPAN&gt;&lt;SPAN&gt;], &lt;/SPAN&gt;&lt;SPAN&gt;self&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;id&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;Definitions&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;ENGAGEMENT_TO_DEAL&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 14 Aug 2023 08:37:44 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Add-timeline-activity-to-new-deals/m-p/833995#M66419</guid>
      <dc:creator>DBurke3</dc:creator>
      <dc:date>2023-08-14T08:37:44Z</dc:date>
    </item>
    <item>
      <title>Re: Add timeline activity to new deals</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Add-timeline-activity-to-new-deals/m-p/834036#M66428</link>
      <description>&lt;P&gt;Glad to hear you got it working&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/613902"&gt;@DBurke3&lt;/a&gt;&amp;nbsp;and thanks for sharing the code above!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Aug 2023 10:02:19 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Add-timeline-activity-to-new-deals/m-p/834036#M66428</guid>
      <dc:creator>coldrickjack</dc:creator>
      <dc:date>2023-08-14T10:02:19Z</dc:date>
    </item>
  </channel>
</rss>

