<?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 Contacts for Secondary Mail in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Search-Contacts-for-Secondary-Mail/m-p/359477#M35341</link>
    <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/124371"&gt;@MGO&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for reaching out. Using the EQ operator when searching on the 'email' property won't return contacts based on their secondary emails; it'll only return contacts with a primary email that matches the search term.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What you might consider doing instead (or in combination) is using the CONTAINS_TOKEN operator and searching the&amp;nbsp;'hs_additional_emails' field. Here's an example body that should do the trick:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;{
  "filterGroups": [
    {
      "filters": [
        {
          "value": "((email))",
          "propertyName": "hs_additional_emails",
          "operator": "CONTAINS_TOKEN"
        }
      ]
    },
    {
      "filters": [
        {
          "value": "((email))",
          "propertyName": "email",
          "operator": "EQ"
        }
      ]
    }
  ]
}&lt;/PRE&gt;</description>
    <pubDate>Tue, 04 Aug 2020 19:40:25 GMT</pubDate>
    <dc:creator>Derek_Gervais</dc:creator>
    <dc:date>2020-08-04T19:40:25Z</dc:date>
    <item>
      <title>Search Contacts for Secondary Mail</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Search-Contacts-for-Secondary-Mail/m-p/358756#M35307</link>
      <description>&lt;P&gt;Hi together,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;we are facing an issue with the search /&amp;nbsp; filter api (V3) on the contacts object.&amp;nbsp;&lt;/P&gt;&lt;P&gt;In our integration scenario we need to get a contact by its email address. If there is no contact found, we create a new one with this specific email address.&lt;BR /&gt;This procedure works as long as the email address&amp;nbsp;is not a secondary email address&amp;nbsp;of any contact.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the email address&amp;nbsp;is a secondary one, the search api can't find the contact. But if we try to create a new contact with this email address&amp;nbsp;it results in an status code&amp;nbsp;409 (Conflict).&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Is there any way to get a contact by its secondary email address?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;BR /&gt;&lt;BR /&gt;Here are some screenshots:&lt;/P&gt;&lt;P&gt;Existing Contact :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ExistingContact.png" style="width: 414px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/29852i47796F082D0CB3BF/image-size/large?v=v2&amp;amp;px=999" role="button" title="ExistingContact.png" alt="ExistingContact.png" /&gt;&lt;/span&gt;&lt;BR /&gt;Create Contact:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CreateContact.png" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/29853i2BF64470F673132F/image-size/large?v=v2&amp;amp;px=999" role="button" title="CreateContact.png" alt="CreateContact.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Search Contact:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SearchContact.png" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/29854i0173E17C9C6EE908/image-size/large?v=v2&amp;amp;px=999" role="button" title="SearchContact.png" alt="SearchContact.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jul 2020 10:59:30 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Search-Contacts-for-Secondary-Mail/m-p/358756#M35307</guid>
      <dc:creator>MGO</dc:creator>
      <dc:date>2020-07-31T10:59:30Z</dc:date>
    </item>
    <item>
      <title>Re: Search Contacts for Secondary Mail</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Search-Contacts-for-Secondary-Mail/m-p/359477#M35341</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/124371"&gt;@MGO&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for reaching out. Using the EQ operator when searching on the 'email' property won't return contacts based on their secondary emails; it'll only return contacts with a primary email that matches the search term.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What you might consider doing instead (or in combination) is using the CONTAINS_TOKEN operator and searching the&amp;nbsp;'hs_additional_emails' field. Here's an example body that should do the trick:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;{
  "filterGroups": [
    {
      "filters": [
        {
          "value": "((email))",
          "propertyName": "hs_additional_emails",
          "operator": "CONTAINS_TOKEN"
        }
      ]
    },
    {
      "filters": [
        {
          "value": "((email))",
          "propertyName": "email",
          "operator": "EQ"
        }
      ]
    }
  ]
}&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Aug 2020 19:40:25 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Search-Contacts-for-Secondary-Mail/m-p/359477#M35341</guid>
      <dc:creator>Derek_Gervais</dc:creator>
      <dc:date>2020-08-04T19:40:25Z</dc:date>
    </item>
  </channel>
</rss>

