Find contacts by several fields (OR)

Hi. My question is can we make an API request to find contacts by several fields?
My case is to find a contact by phone number. But it can be PHONE1 or PHONE2. Is there a possibility to make ONE request to search by two fields? From what I see in docs we can only find a contact by email or by one field (DataService.findByField) or make a DataService.query requests.
DataService.query request allows to make complicated query but as far as I understand from examples and docs it only allows ‘AND’ queries but I need ‘OR’ query.
Kind of ‘select from contacts where PHONE1=123 OR PHONE2=123’ :smiley:

Hi @Steve_Osler, the findByField method only takes one field as its criteria per call. This would require 2 calls, one call for PHONE1 and one call for PHONE2. Unfortunately, DataService.query, will use AND in order to find a matching record.

For example:

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>DataService.query</methodName>
  <params>
    <param>
      <value><string>{{APIKey}}</string></value>
    </param>
    <param>
      <value><string>Contact</string></value>
    </param>
    <param>
      <value><int>1000</int></value>
    </param>
    <param>
      <value><int>0</int></value>
    </param>
    <param>
      <value><struct>
      	<member><name>PHONE1</name>
          <value><string>(480) 442-2222</string></value>
        </member>
        <member><name>PHONE2</name>
          <value><string>(480) 442-2222</string></value>
        </member>
      </struct></value>
    </param>
    <param>
      <value><array>
        <data>
          <value><string>Id</string></value>
          <value><string>FirstName</string></value>
          <value><string>Email</string></value>
        </data>
      </array></value>
    </param>
    <param>
      <value><string>Id</string></value>
    </param>
    <param>
      <value><boolean>1</boolean></value>
    </param>
  </params>
</methodCall>

would only match a contact whose PHONE1 AND PHONE2 are (480) 442-2222