<?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 create and associate files with Deals? in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/How-to-create-and-associate-files-with-Deals/m-p/546061#M49662</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/299801"&gt;@jpinto_ic&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To do this you'll need to make two api calls. The first is uploading the file, the second is adding it as an attachment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To upload the file use &lt;A href="https://developers.hubspot.com/docs/api/files/files" target="_blank" rel="noopener"&gt;the&amp;nbsp;&lt;/A&gt;&lt;SPAN&gt;&lt;A href="https://developers.hubspot.com/docs/api/files/files" target="_blank" rel="noopener"&gt;/files/v3/files endpoint&lt;/A&gt;. Here is an example call:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JBeatty_0-1640189182176.png" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/56218i8B6B3960D3081459/image-size/large?v=v2&amp;amp;px=999" role="button" title="JBeatty_0-1640189182176.png" alt="JBeatty_0-1640189182176.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Notice the multipart form data for the content type.&lt;BR /&gt;&lt;BR /&gt;Then with the returned ID in green, you want to add a note to the deal with that attachment. Using &lt;A href="https://legacydocs.hubspot.com/docs/methods/engagements/create_engagement" target="_blank" rel="noopener"&gt;the&amp;nbsp;/engagements/v1/engagements endpoint&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JBeatty_3-1640189353109.png" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/56221iE53A5D423066E720/image-size/large?v=v2&amp;amp;px=999" role="button" title="JBeatty_3-1640189353109.png" alt="JBeatty_3-1640189353109.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;If you set the timestamp to the current time(in milliseconds, unix epoch) the empty note will appear at the top of the timeline, you can set it further back so the note does not clutter up the timeline. Regardless the attachment will still appear on the sidebar.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JBeatty_2-1640189305121.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/56220iE66A6711EF3C8F22/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JBeatty_2-1640189305121.png" alt="JBeatty_2-1640189305121.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 22 Dec 2021 16:10:33 GMT</pubDate>
    <dc:creator>JBeatty</dc:creator>
    <dc:date>2021-12-22T16:10:33Z</dc:date>
    <item>
      <title>How to create and associate files with Deals?</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/How-to-create-and-associate-files-with-Deals/m-p/545597#M49631</link>
      <description>&lt;P&gt;Hello, everyone. I would like to create and associate files with Deals so that they show up under the attachments panel on the deal page like in the following example:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jpinto_ic_0-1640108112349.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/56165iE0CA32B8F4ECA2F4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jpinto_ic_0-1640108112349.png" alt="jpinto_ic_0-1640108112349.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Can this be achieved throught the API?&lt;/P&gt;</description>
      <pubDate>Tue, 21 Dec 2021 17:36:17 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/How-to-create-and-associate-files-with-Deals/m-p/545597#M49631</guid>
      <dc:creator>jpinto_ic</dc:creator>
      <dc:date>2021-12-21T17:36:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to create and associate files with Deals?</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/How-to-create-and-associate-files-with-Deals/m-p/545658#M49640</link>
      <description>&lt;P&gt;I think &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/193060"&gt;@JBeatty&lt;/a&gt; 's post &lt;A href="https://community.hubspot.com/t5/APIs-Integrations/How-to-get-file-attachments-associated-to-a-single-deal-with-API/td-p/453404" target="_blank" rel="noopener"&gt;here&lt;/A&gt; should point you in the right direction to achieve this&lt;/P&gt;</description>
      <pubDate>Tue, 21 Dec 2021 19:20:16 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/How-to-create-and-associate-files-with-Deals/m-p/545658#M49640</guid>
      <dc:creator>dennisedson</dc:creator>
      <dc:date>2021-12-21T19:20:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to create and associate files with Deals?</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/How-to-create-and-associate-files-with-Deals/m-p/545874#M49654</link>
      <description>&lt;P&gt;Hello. That post details how to retrieve the attachments of a deal not how to add attachments to a deal, which is what I was trying to accomplish. Additionally, the answers seem to be using an API version that is no longer valid.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Dec 2021 09:45:06 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/How-to-create-and-associate-files-with-Deals/m-p/545874#M49654</guid>
      <dc:creator>jpinto_ic</dc:creator>
      <dc:date>2021-12-22T09:45:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to create and associate files with Deals?</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/How-to-create-and-associate-files-with-Deals/m-p/546061#M49662</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/299801"&gt;@jpinto_ic&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To do this you'll need to make two api calls. The first is uploading the file, the second is adding it as an attachment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To upload the file use &lt;A href="https://developers.hubspot.com/docs/api/files/files" target="_blank" rel="noopener"&gt;the&amp;nbsp;&lt;/A&gt;&lt;SPAN&gt;&lt;A href="https://developers.hubspot.com/docs/api/files/files" target="_blank" rel="noopener"&gt;/files/v3/files endpoint&lt;/A&gt;. Here is an example call:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JBeatty_0-1640189182176.png" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/56218i8B6B3960D3081459/image-size/large?v=v2&amp;amp;px=999" role="button" title="JBeatty_0-1640189182176.png" alt="JBeatty_0-1640189182176.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Notice the multipart form data for the content type.&lt;BR /&gt;&lt;BR /&gt;Then with the returned ID in green, you want to add a note to the deal with that attachment. Using &lt;A href="https://legacydocs.hubspot.com/docs/methods/engagements/create_engagement" target="_blank" rel="noopener"&gt;the&amp;nbsp;/engagements/v1/engagements endpoint&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JBeatty_3-1640189353109.png" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/56221iE53A5D423066E720/image-size/large?v=v2&amp;amp;px=999" role="button" title="JBeatty_3-1640189353109.png" alt="JBeatty_3-1640189353109.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;If you set the timestamp to the current time(in milliseconds, unix epoch) the empty note will appear at the top of the timeline, you can set it further back so the note does not clutter up the timeline. Regardless the attachment will still appear on the sidebar.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JBeatty_2-1640189305121.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/56220iE66A6711EF3C8F22/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JBeatty_2-1640189305121.png" alt="JBeatty_2-1640189305121.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Dec 2021 16:10:33 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/How-to-create-and-associate-files-with-Deals/m-p/546061#M49662</guid>
      <dc:creator>JBeatty</dc:creator>
      <dc:date>2021-12-22T16:10:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to create and associate files with Deals?</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/How-to-create-and-associate-files-with-Deals/m-p/546066#M49664</link>
      <description>&lt;P&gt;Thanks, Joshua. So, in conclusion, the only way of adding a file to a deal is by associating a deal with a note that has that file attached to it (the note).&lt;/P&gt;</description>
      <pubDate>Wed, 22 Dec 2021 16:15:49 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/How-to-create-and-associate-files-with-Deals/m-p/546066#M49664</guid>
      <dc:creator>jpinto_ic</dc:creator>
      <dc:date>2021-12-22T16:15:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to create and associate files with Deals?</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/How-to-create-and-associate-files-with-Deals/m-p/546080#M49665</link>
      <description>&lt;P&gt;That is correct&lt;/P&gt;</description>
      <pubDate>Wed, 22 Dec 2021 16:35:51 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/How-to-create-and-associate-files-with-Deals/m-p/546080#M49665</guid>
      <dc:creator>JBeatty</dc:creator>
      <dc:date>2021-12-22T16:35:51Z</dc:date>
    </item>
  </channel>
</rss>

