<?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: Search companies by phone number returns unexpected results in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Search-companies-by-phone-number-returns-unexpected-results/m-p/1081510#M78860</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;A href="https://docs.google.com/spreadsheets/d/16WeQD6lLS4PXumMKOGIEVNyYfVCO3Pxp8tdP1rueyys/edit?usp=sharing" target="_blank" rel="noopener"&gt;@LianYiFei&lt;/A&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've encountered an API issue, when search companies by phone number via search API, some of them with specific format are not in the results. For example, when query with "*7207159789", only #1/2/3 are returned, and #4/5 are not&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;+17207159789&lt;/LI&gt;&lt;LI&gt;17207159789&lt;/LI&gt;&lt;LI&gt;7207159789&lt;/LI&gt;&lt;LI&gt;+1 (720) 7159-789&lt;/LI&gt;&lt;LI&gt;(720) 7159-789&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;The API we use is&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;curl --location 'https://api.hubapi.com/crm/v3/objects/company/search' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data '{
    "query": "*7207159789"
}'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By the way, using the same query for contacts, all of the above phone numbers can be identified.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wonder if this is a known issue, or if we can make it respond the same way as the Contact API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;It could be due to how phone numbers are processed and normalized by the API. The Contacts API seems to handle different phone number formats, such as with or without country codes, parentheses, or spaces, more flexibly. However, the Company Search API may not normalize phone numbers in the same way, leading to inconsistencies in search results. Additionally, the wildcard search query you're using ("*7207159789") might not be interpreted consistently across all formats. As a result, certain phone number formats may not return the expected results. This issue could be resolved by adjusting the search query or ensuring phone numbers are consistently formatted before querying.&lt;/P&gt;</description>
    <pubDate>Tue, 10 Dec 2024 14:09:26 GMT</pubDate>
    <dc:creator>HMir</dc:creator>
    <dc:date>2024-12-10T14:09:26Z</dc:date>
    <item>
      <title>Search companies by phone number returns unexpected results</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Search-companies-by-phone-number-returns-unexpected-results/m-p/1081198#M78847</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've encountered an API issue, when search companies by phone number via search API, some of them with specific format are not in the results. For example, when query with "*7207159789", only #1/2/3 are returned, and #4/5 are not&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;+17207159789&lt;/LI&gt;&lt;LI&gt;17207159789&lt;/LI&gt;&lt;LI&gt;7207159789&lt;/LI&gt;&lt;LI&gt;+1 (720) 7159-789&lt;/LI&gt;&lt;LI&gt;(720) 7159-789&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;The API we use is&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;curl --location 'https://api.hubapi.com/crm/v3/objects/company/search' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data '{
    "query": "*7207159789"
}'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By the way, using the same query for contacts, all of the above phone numbers can be identified.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wonder if this is a known issue, or if we can make it respond the same way as the Contact API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2024 01:02:10 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Search-companies-by-phone-number-returns-unexpected-results/m-p/1081198#M78847</guid>
      <dc:creator>LianYiFei</dc:creator>
      <dc:date>2024-12-10T01:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: Search companies by phone number returns unexpected results</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Search-companies-by-phone-number-returns-unexpected-results/m-p/1081510#M78860</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;A href="https://docs.google.com/spreadsheets/d/16WeQD6lLS4PXumMKOGIEVNyYfVCO3Pxp8tdP1rueyys/edit?usp=sharing" target="_blank" rel="noopener"&gt;@LianYiFei&lt;/A&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've encountered an API issue, when search companies by phone number via search API, some of them with specific format are not in the results. For example, when query with "*7207159789", only #1/2/3 are returned, and #4/5 are not&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;+17207159789&lt;/LI&gt;&lt;LI&gt;17207159789&lt;/LI&gt;&lt;LI&gt;7207159789&lt;/LI&gt;&lt;LI&gt;+1 (720) 7159-789&lt;/LI&gt;&lt;LI&gt;(720) 7159-789&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;The API we use is&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;curl --location 'https://api.hubapi.com/crm/v3/objects/company/search' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data '{
    "query": "*7207159789"
}'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By the way, using the same query for contacts, all of the above phone numbers can be identified.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wonder if this is a known issue, or if we can make it respond the same way as the Contact API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;It could be due to how phone numbers are processed and normalized by the API. The Contacts API seems to handle different phone number formats, such as with or without country codes, parentheses, or spaces, more flexibly. However, the Company Search API may not normalize phone numbers in the same way, leading to inconsistencies in search results. Additionally, the wildcard search query you're using ("*7207159789") might not be interpreted consistently across all formats. As a result, certain phone number formats may not return the expected results. This issue could be resolved by adjusting the search query or ensuring phone numbers are consistently formatted before querying.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2024 14:09:26 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Search-companies-by-phone-number-returns-unexpected-results/m-p/1081510#M78860</guid>
      <dc:creator>HMir</dc:creator>
      <dc:date>2024-12-10T14:09:26Z</dc:date>
    </item>
    <item>
      <title>Re: Search companies by phone number returns unexpected results</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Search-companies-by-phone-number-returns-unexpected-results/m-p/1081903#M78878</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/686870"&gt;@LianYiFei&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Here is the curl for company search API&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;curl --location 'https://api.hubapi.com/crm/v3/objects/contacts/search' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer pat-na1-8783b435-676a-4dc0-ad65-7d1a2fbdcb7c' \
--data '{
  "filterGroups": [
    {
      "filters": [
        {
            "propertyName": "phone",
            "operator": "EQ",
            "value": ""
        }
      ]
    }
  ]
}'&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-sheets-root="1"&gt;I hope this will help you out. Please mark it as &lt;STRONG&gt;Solution Accepted and upvote&lt;/STRONG&gt; to help another Community member.&lt;BR /&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2024 06:44:44 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Search-companies-by-phone-number-returns-unexpected-results/m-p/1081903#M78878</guid>
      <dc:creator>GRajput</dc:creator>
      <dc:date>2024-12-11T06:44:44Z</dc:date>
    </item>
    <item>
      <title>Re: Search companies by phone number returns unexpected results</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Search-companies-by-phone-number-returns-unexpected-results/m-p/1081906#M78879</link>
      <description>&lt;P&gt;Thanks, but it doesn't work, with the "filterGroup", the results respond even less then the "query" search way&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2024 06:48:57 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Search-companies-by-phone-number-returns-unexpected-results/m-p/1081906#M78879</guid>
      <dc:creator>LianYiFei</dc:creator>
      <dc:date>2024-12-11T06:48:57Z</dc:date>
    </item>
  </channel>
</rss>

