<?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: Getting all notes in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Getting-all-notes/m-p/727187#M59403</link>
    <description>&lt;P&gt;Thank you for the reply! Ok good to know but one question. Is it possible to get all notes from a certain sales person instead of companies?&lt;/P&gt;</description>
    <pubDate>Tue, 06 Dec 2022 14:18:41 GMT</pubDate>
    <dc:creator>GKristjansson</dc:creator>
    <dc:date>2022-12-06T14:18:41Z</dc:date>
    <item>
      <title>Getting all notes</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Getting-all-notes/m-p/727049#M59392</link>
      <description>&lt;P&gt;I am trying to extract all notes from my companies HubSpot account. The code returns some things but no notes. This is the code, can anyone tell me why?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;client&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;hubspot&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Client&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;access_token&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"access token which I will not post here"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;try&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&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t;SPAN&gt;print&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"Exception when calling basic_api-&amp;gt;get_page: &lt;/SPAN&gt;&lt;SPAN&gt;%s&lt;/SPAN&gt;&lt;SPAN&gt;\n&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt; % &lt;/SPAN&gt;&lt;SPAN&gt;e&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 06 Dec 2022 09:44:43 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Getting-all-notes/m-p/727049#M59392</guid>
      <dc:creator>GKristjansson</dc:creator>
      <dc:date>2022-12-06T09:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: Getting all notes</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Getting-all-notes/m-p/727177#M59402</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/460273"&gt;@GKristjansson&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;cool that you're trying to get some data from HubSpot using the Python API library.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You're basically gives you all the note no matter if they were associated with a company or any object for that matter.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What you need to do is request notes by ID individually or a batch read. But you need the IDs of these notes first. To get them from one company you need to call:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;api_response = client.crm.companies.associations_api.get_all(company_id=5800956379, to_object_type="NOTES", limit=500)&lt;BR /&gt;pprint(api_response)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Pasting it here is butchering the tabs but you get the idea.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You then receive all the note IDs associated with that company. You then can access them like this in read call:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;api_response = client.crm.objects.notes.basic_api.get_by_id(note_id="14935624419", properties=["hs_note_body"], archived=False)&lt;BR /&gt;pprint(api_response)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is important to define what properties you want to access. The content of a note is saved in&amp;nbsp;&lt;EM&gt;hs_note_body.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you found this post helpful, consider helping others in the community to find answers faster by marking this as a solution. I'd really appreciate it.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Chriso&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 14:10:12 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Getting-all-notes/m-p/727177#M59402</guid>
      <dc:creator>ChrisoKlepke</dc:creator>
      <dc:date>2022-12-06T14:10:12Z</dc:date>
    </item>
    <item>
      <title>Re: Getting all notes</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Getting-all-notes/m-p/727187#M59403</link>
      <description>&lt;P&gt;Thank you for the reply! Ok good to know but one question. Is it possible to get all notes from a certain sales person instead of companies?&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 14:18:41 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Getting-all-notes/m-p/727187#M59403</guid>
      <dc:creator>GKristjansson</dc:creator>
      <dc:date>2022-12-06T14:18:41Z</dc:date>
    </item>
  </channel>
</rss>

