<?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 download specific fields for every contact in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/How-to-download-specific-fields-for-every-contact/m-p/886874#M69401</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can specify the properties returned in the response by adding them to the request.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can add an array "properties=[]" and specify which properties. In this case I've added "Test Property" but you can add multiple&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;try:&lt;BR /&gt;api_response = client.crm.contacts.default_api.get_page(limit=10, properties=["test property", "another test property"], archived=False)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Then when you make the request you'll get the data for each property added. Hope this helps!&lt;/P&gt;</description>
    <pubDate>Wed, 29 Nov 2023 23:34:37 GMT</pubDate>
    <dc:creator>LewTalon</dc:creator>
    <dc:date>2023-11-29T23:34:37Z</dc:date>
    <item>
      <title>How to download specific fields for every contact</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/How-to-download-specific-fields-for-every-contact/m-p/886847#M69398</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create an API integration with Hubspot using Python via a Private App.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Was able to successfully Hit the API and get back contacts data but output shows only few fields.&lt;/P&gt;&lt;P&gt;Here is my code so far:&lt;BR /&gt;from hubspot import HubSpot&lt;BR /&gt;from hubspot.crm.objects import ApiException&lt;BR /&gt;&lt;BR /&gt;api_client = HubSpot()&lt;BR /&gt;api_client.access_token = '***-***-********-****-****-****-************'&lt;BR /&gt;try:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; all_contacts = api_client.crm.contacts.get_all()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for itm in all_contacts:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print(itm)&lt;BR /&gt;except ApiException as e:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print("Exception when requesting custom objects: %s\n" % e)&lt;BR /&gt;&lt;BR /&gt;Output JSON has only 13 fields, I need to see 57 fields.&lt;BR /&gt;&lt;BR /&gt;Any inputs/tips/help in solving this will really be much appriciated.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2023 22:49:29 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/How-to-download-specific-fields-for-every-contact/m-p/886847#M69398</guid>
      <dc:creator>SMukherjee9</dc:creator>
      <dc:date>2023-11-29T22:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to download specific fields for every contact</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/How-to-download-specific-fields-for-every-contact/m-p/886874#M69401</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can specify the properties returned in the response by adding them to the request.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can add an array "properties=[]" and specify which properties. In this case I've added "Test Property" but you can add multiple&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;try:&lt;BR /&gt;api_response = client.crm.contacts.default_api.get_page(limit=10, properties=["test property", "another test property"], archived=False)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Then when you make the request you'll get the data for each property added. Hope this helps!&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2023 23:34:37 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/How-to-download-specific-fields-for-every-contact/m-p/886874#M69401</guid>
      <dc:creator>LewTalon</dc:creator>
      <dc:date>2023-11-29T23:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to download specific fields for every contact</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/How-to-download-specific-fields-for-every-contact/m-p/886913#M69405</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/178256"&gt;@LewTalon&lt;/a&gt; - &lt;FONT face="comic sans ms,sans-serif"&gt;Thanks a ton for the input&lt;/FONT&gt;! &lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt; It worked!&lt;BR /&gt;However, I need help seeing specific properties due to my limited understanding of this platform. Is there a way by which I can see &lt;FONT color="#993300"&gt;&lt;EM&gt;all the properties of a contact ( both default and custom )&lt;/EM&gt;&lt;/FONT&gt;? I tried this from the documentation but only got an Invalid API error. In the previous case, the API key is working perfectly fine.&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;From Documentation&lt;/STRONG&gt;:&lt;BR /&gt;&lt;A href="https://legacydocs.hubspot.com/docs/methods/contacts/v2/get_contacts_properties" target="_blank" rel="noopener"&gt;https://legacydocs.hubspot.com/docs/methods/contacts/v2/get_contacts_properties&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;My Code&lt;/STRONG&gt;:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;import &lt;/SPAN&gt;requests&lt;BR /&gt;&lt;BR /&gt;url = &lt;SPAN&gt;"https://api.hubapi.com/properties/v1/contacts/properties"&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;querystring = {&lt;SPAN&gt;'hapikey'&lt;/SPAN&gt;: &lt;SPAN&gt;'Bearer ***-***-********-****-****-****-************'&lt;/SPAN&gt;}&lt;BR /&gt;&lt;BR /&gt;response = requests.request(&lt;SPAN&gt;"GET"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;url&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;params&lt;/SPAN&gt;=querystring)&lt;BR /&gt;&lt;SPAN&gt;print&lt;/SPAN&gt;(response.text)&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Output&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;{"status":"error","message":"The API key provided is invalid. View or manage your API key here: &lt;A href="https://app.hubspot.com/l/api-key/" target="_blank" rel="noopener"&gt;https://app.hubspot.com/l/api-key/&lt;/A&gt;","correlationId":"********-****-****-****-************","category":"INVALID_AUTHENTICATION","links":{"api key":"&lt;A href="https://app.hubspot.com/l/api-key/" target="_blank" rel="noopener"&gt;https://app.hubspot.com/l/api-key/&lt;/A&gt;"}}&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2023 01:53:57 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/How-to-download-specific-fields-for-every-contact/m-p/886913#M69405</guid>
      <dc:creator>SMukherjee9</dc:creator>
      <dc:date>2023-11-30T01:53:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to download specific fields for every contact</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/How-to-download-specific-fields-for-every-contact/m-p/886922#M69406</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/671485"&gt;@SMukherjee9&lt;/a&gt;&amp;nbsp; Glad I helped answer the question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In order to retrieve all properties, you will need to include them all within that array.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In order to format the request quickly you can just use this endpoint (it's the same one you mentioned but a newer version)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;url = &lt;SPAN&gt;"https://api.hubapi.com/crm/v3/properties/contacts"&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;This will give you a full list of all the properties in the system (an internal list, not the values on the specific record.) Then you can use something like JSON to CSV (or create a script to just get the "name" value. (something like results.name[0] for each result in the array.) This will give you a full list of all the properties internal name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then you can add those all to the initial request, and you'll get a list of all the properties for that specific contact.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, note that the response you sent indicates Invalid Authentication - this means your access token is invalid. You should be able to get it within your private app.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Feel free to DM me if you need any help.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2023 02:42:40 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/How-to-download-specific-fields-for-every-contact/m-p/886922#M69406</guid>
      <dc:creator>LewTalon</dc:creator>
      <dc:date>2023-11-30T02:42:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to download specific fields for every contact</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/How-to-download-specific-fields-for-every-contact/m-p/887416#M69431</link>
      <description>&lt;P&gt;Thanks again &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/178256"&gt;@LewTalon&lt;/a&gt;!! &lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":fire:"&gt;🔥&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":fire:"&gt;🔥&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2023 20:31:56 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/How-to-download-specific-fields-for-every-contact/m-p/887416#M69431</guid>
      <dc:creator>SMukherjee9</dc:creator>
      <dc:date>2023-11-30T20:31:56Z</dc:date>
    </item>
  </channel>
</rss>

