<?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: Error of Search Contact API when response over 10,000 contacts in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Error-of-Search-Contact-API-when-response-over-10-000-contacts/m-p/608741#M52229</link>
    <description>&lt;P&gt;No worries!&amp;nbsp; Hope you can refactor your code accordingly!&lt;/P&gt;</description>
    <pubDate>Wed, 06 Apr 2022 02:37:20 GMT</pubDate>
    <dc:creator>dennisedson</dc:creator>
    <dc:date>2022-04-06T02:37:20Z</dc:date>
    <item>
      <title>Error of Search Contact API when response over 10,000 contacts</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Error-of-Search-Contact-API-when-response-over-10-000-contacts/m-p/607927#M52186</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I met this error and i dont know why. I search the lastmodified contact after a timestamp:&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;public_object_search_request = PublicObjectSearchRequest(filter_groups=[{"filters":[{"value":"1649130562421",&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;"propertyName":"lastmodifieddate",&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;"operator":"GTE"}]}],&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;sorts=["DESCENDING"], &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;properties=["id"],&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;limit=100, &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;after=9900)&lt;BR /&gt;try:&lt;BR /&gt;api_response = client.crm.contacts.search_api.do_search(public_object_search_request=public_object_search_request)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;pprint(api_response)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;except ApiException as e:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;print("Exception when calling search_api-&amp;gt;do_search: %s\n" % e)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="4"&gt;Resonpse:&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;"total": 10010,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;"results": []&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;"paging": {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;"next": {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;"after": "10000"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="4"&gt;After this response, I call this request:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;public_object_search_request = PublicObjectSearchRequest(filter_groups=[{"filters":[{"value":"1649130562421",&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;"propertyName":"lastmodifieddate",&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;"operator":"GTE"}]}],&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;sorts=["DESCENDING"], &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;properties=["id"],&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;limit=100, &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;after=10000)&lt;BR /&gt;try:&lt;BR /&gt;api_response = client.crm.contacts.search_api.do_search(public_object_search_request=public_object_search_request)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;pprint(api_response)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;except ApiException as e:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;print("Exception when calling search_api-&amp;gt;do_search: %s\n" % e)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I got this response:&lt;/P&gt;&lt;P&gt;HTTP 400&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;{&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;"status": "error",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;"message": "There was a problem with the request.",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;"correlationId": "2e7a35b9-dc8b-4cb5-8db8-4a573efe7cfc"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I doing wrong here?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much!!!!&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2022 09:33:51 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Error-of-Search-Contact-API-when-response-over-10-000-contacts/m-p/607927#M52186</guid>
      <dc:creator>pmaxodoo</dc:creator>
      <dc:date>2022-04-05T09:33:51Z</dc:date>
    </item>
    <item>
      <title>Re: Error of Search Contact API when response over 10,000 contacts</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Error-of-Search-Contact-API-when-response-over-10-000-contacts/m-p/608312#M52212</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/361121"&gt;@pmaxodoo&lt;/a&gt; ,&lt;/P&gt;
&lt;P&gt;If you look in the &lt;A href="https://developers.hubspot.com/docs/api/crm/search#limitations" target="_blank" rel="noopener"&gt;docs&lt;/A&gt;, there is actually a limit of the Search API with results over 10k.&amp;nbsp; When you hit that limit, you can expect a 400 error.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2022 17:14:21 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Error-of-Search-Contact-API-when-response-over-10-000-contacts/m-p/608312#M52212</guid>
      <dc:creator>dennisedson</dc:creator>
      <dc:date>2022-04-05T17:14:21Z</dc:date>
    </item>
    <item>
      <title>Re: Error of Search Contact API when response over 10,000 contacts</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Error-of-Search-Contact-API-when-response-over-10-000-contacts/m-p/608737#M52228</link>
      <description>&lt;P&gt;Thanks,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/13982"&gt;@dennisedson&lt;/a&gt;. My fault for not reading all the docs carefully.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2022 02:29:37 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Error-of-Search-Contact-API-when-response-over-10-000-contacts/m-p/608737#M52228</guid>
      <dc:creator>pmaxodoo</dc:creator>
      <dc:date>2022-04-06T02:29:37Z</dc:date>
    </item>
    <item>
      <title>Re: Error of Search Contact API when response over 10,000 contacts</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Error-of-Search-Contact-API-when-response-over-10-000-contacts/m-p/608741#M52229</link>
      <description>&lt;P&gt;No worries!&amp;nbsp; Hope you can refactor your code accordingly!&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2022 02:37:20 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Error-of-Search-Contact-API-when-response-over-10-000-contacts/m-p/608741#M52229</guid>
      <dc:creator>dennisedson</dc:creator>
      <dc:date>2022-04-06T02:37:20Z</dc:date>
    </item>
  </channel>
</rss>

