<?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: HubSpot Calls API - How to Results to Yesterday Activity Date? in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/HubSpot-Calls-API-How-to-Results-to-Yesterday-Activity-Date/m-p/954147#M72472</link>
    <description>&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/637792"&gt;@aaron_payne&lt;/a&gt;&lt;/SPAN&gt; &lt;span class="lia-unicode-emoji" title=":waving_hand:"&gt;👋&lt;/span&gt; The search API is likely your best bet as it allows for filters, search operators, and sorting. The endpoint &lt;A href="https://api.hubapi.com/crm/v3/objects/calls" target="_blank"&gt;https://api.hubapi.com/crm/v3/objects/calls&lt;/A&gt; doesn't offer those options.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have fun building! — Jaycee&lt;/P&gt;</description>
    <pubDate>Wed, 03 Apr 2024 16:56:24 GMT</pubDate>
    <dc:creator>Jaycee_Lewis</dc:creator>
    <dc:date>2024-04-03T16:56:24Z</dc:date>
    <item>
      <title>HubSpot Calls API - How to Results to Yesterday Activity Date?</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/HubSpot-Calls-API-How-to-Results-to-Yesterday-Activity-Date/m-p/953531#M72434</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to pull all call records from HubSpot from the previous day. I am trying two different end points but am unsure of what the best method is to pull these call records.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Endpoints&lt;/P&gt;&lt;P&gt;-&amp;nbsp;&lt;A href="https://api.hubapi.com/crm/v3/objects/calls" target="_blank"&gt;https://api.hubapi.com/crm/v3/objects/calls&lt;/A&gt;&lt;/P&gt;&lt;P&gt;-&amp;nbsp;&lt;A href="https://api.hubapi.com/crm/v3/objects/calls/search" target="_blank"&gt;https://api.hubapi.com/crm/v3/objects/calls/search&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Examples&lt;/P&gt;&lt;P&gt;1. I am using this enpoint that does return results but I am not sure how to filter the data to yesterday. The results seem to be from years ago and not showing the activity date of yesterday. Code below.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;headers = {&lt;BR /&gt;'Authorization': 'Bearer xxxxxx',&lt;BR /&gt;'Content-Type': 'application/json'&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;properties = ["hs_call_title","activity_date"]&lt;/P&gt;&lt;P&gt;# Calculate the start and end timestamps for yesterday&lt;BR /&gt;yesterday = datetime.now() - timedelta(days=1)&lt;BR /&gt;start_timestamp = yesterday.strftime('%Y-%m-%d')&lt;BR /&gt;end_timestamp = yesterday.strftime('%Y-%m-%d')&lt;/P&gt;&lt;P&gt;# Specify parameters for the request&lt;BR /&gt;params = {&lt;BR /&gt;'limit': 100, # Adjust the limit as needed&lt;BR /&gt;'archived': False, # Exclude archived calls&lt;BR /&gt;'sort': 'createdAt ASC', # Sort by creation date in ascending order&lt;BR /&gt;'createdAt.gte': start_timestamp, # Filter calls created after the start of yesterday&lt;BR /&gt;'createdAt.lte': end_timestamp, # Filter calls created before the end of yesterday&lt;BR /&gt;'properties': properties # Include specified properties&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;# Make the API request&lt;BR /&gt;#response = requests.get('&lt;A href="https://api.hubapi.com/engagements/v1/engagements/paged" target="_blank"&gt;https://api.hubapi.com/engagements/v1/engagements/paged&lt;/A&gt;', headers=headers, params=params)&lt;BR /&gt;response = requests.get('&lt;A href="https://api.hubapi.com/crm/v3/objects/calls" target="_blank"&gt;https://api.hubapi.com/crm/v3/objects/calls&lt;/A&gt;', headers=headers, params=params)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example 2&lt;/P&gt;&lt;P&gt;I am using the Search endpoint and getting an error with the filter groups JSON. Code below&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;headers = {&lt;BR /&gt;'Authorization': 'Bearer xxxxxxx',&lt;BR /&gt;'Content-Type': 'application/json'&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;# Calculate the start and end timestamps for yesterday&lt;BR /&gt;yesterday = datetime.now() - timedelta(days=1)&lt;BR /&gt;start_timestamp = yesterday.strftime('%Y-%m-%d') + "T00:00:00Z" # Start of yesterday&lt;BR /&gt;end_timestamp = yesterday.strftime('%Y-%m-%d') + "T23:59:59Z" # End of yesterday&lt;/P&gt;&lt;P&gt;# Specify parameters for the request&lt;BR /&gt;# Construct the search query&lt;BR /&gt;query = {&lt;BR /&gt;"filterGroups": [&lt;BR /&gt;{&lt;BR /&gt;"filters": [&lt;BR /&gt;{&lt;BR /&gt;"propertyName": "createdate",&lt;BR /&gt;"operator": "BETWEEN",&lt;BR /&gt;"value": [start_timestamp, end_timestamp]&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;],&lt;BR /&gt;"properties": ["hs_call_title"] # Include specified properties&lt;BR /&gt;}&lt;BR /&gt;# Make the API request&lt;BR /&gt;#response = requests.get('&lt;A href="https://api.hubapi.com/engagements/v1/engagements/paged" target="_blank"&gt;https://api.hubapi.com/engagements/v1/engagements/paged&lt;/A&gt;', headers=headers, params=params)&lt;BR /&gt;response = requests.post('&lt;A href="https://api.hubapi.com/crm/v3/objects/calls/search" target="_blank"&gt;https://api.hubapi.com/crm/v3/objects/calls/search&lt;/A&gt;', headers=headers, json=query)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the best way to simply pull all calls from the previous day?&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2024 19:11:30 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/HubSpot-Calls-API-How-to-Results-to-Yesterday-Activity-Date/m-p/953531#M72434</guid>
      <dc:creator>aaron_payne</dc:creator>
      <dc:date>2024-04-02T19:11:30Z</dc:date>
    </item>
    <item>
      <title>Re: HubSpot Calls API - How to Results to Yesterday Activity Date?</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/HubSpot-Calls-API-How-to-Results-to-Yesterday-Activity-Date/m-p/954147#M72472</link>
      <description>&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/637792"&gt;@aaron_payne&lt;/a&gt;&lt;/SPAN&gt; &lt;span class="lia-unicode-emoji" title=":waving_hand:"&gt;👋&lt;/span&gt; The search API is likely your best bet as it allows for filters, search operators, and sorting. The endpoint &lt;A href="https://api.hubapi.com/crm/v3/objects/calls" target="_blank"&gt;https://api.hubapi.com/crm/v3/objects/calls&lt;/A&gt; doesn't offer those options.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have fun building! — Jaycee&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 16:56:24 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/HubSpot-Calls-API-How-to-Results-to-Yesterday-Activity-Date/m-p/954147#M72472</guid>
      <dc:creator>Jaycee_Lewis</dc:creator>
      <dc:date>2024-04-03T16:56:24Z</dc:date>
    </item>
    <item>
      <title>Re: HubSpot Calls API - How to Results to Yesterday Activity Date?</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/HubSpot-Calls-API-How-to-Results-to-Yesterday-Activity-Date/m-p/954192#M72477</link>
      <description>&lt;P&gt;Hi Jaycee, thank&amp;nbsp; you for that information! Would it be possible to show an example code Python code block with the filters included the json query?&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 17:44:01 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/HubSpot-Calls-API-How-to-Results-to-Yesterday-Activity-Date/m-p/954192#M72477</guid>
      <dc:creator>aaron_payne</dc:creator>
      <dc:date>2024-04-03T17:44:01Z</dc:date>
    </item>
    <item>
      <title>Re: HubSpot Calls API - How to Results to Yesterday Activity Date?</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/HubSpot-Calls-API-How-to-Results-to-Yesterday-Activity-Date/m-p/1202506#M84448</link>
      <description>&lt;P&gt;Hi-&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know some time has passed since your post, but in case anyone has a similar question in the future.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is JSON that worked for me - I specified the date using &lt;A href="https://developers.hubspot.com/docs/api-reference/search/guide" target="_blank" rel="noopener"&gt;the GTE and LT operators&lt;/A&gt; for the time filters:&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;{
  "filterGroups": [
    {
      "filters": [
        {
          "propertyName": "hs_timestamp",
          "operator": "GTE",
          "value": 1758204000000 // ms UNIX timestamp at 0:00 am
        },
        {
          "propertyName": "hs_timestamp",
          "operator": "LTE",
          "value": 1758290400000 // ms UNIX timestamp at 0:00 am of the following day
        }
      ]
    }
  ],
  "properties": ["hubspot_owner_id"],
  "limit": 100,
  "after": 0
}&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;Hope this helps someone!&lt;/P&gt;</description>
      <pubDate>Fri, 19 Sep 2025 13:02:02 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/HubSpot-Calls-API-How-to-Results-to-Yesterday-Activity-Date/m-p/1202506#M84448</guid>
      <dc:creator>halice</dc:creator>
      <dc:date>2025-09-19T13:02:02Z</dc:date>
    </item>
  </channel>
</rss>

