title: Microsoft Graph API - search on multiple email addresses?
body: <p>I’m trying to query the Graph API to return me mail messages that are from OR to a particular email address by using the “participants” search term.</p>
  <p>Docs here; <a href="https://docs.microsoft.com/en-us/graph/query-parameters" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/graph/query-parameters</a></p>
  <p>Code example (working):</p>
  <pre><code>$encoded_addresses = urlencode(&quot;participants:email@domain.com&quot;);
  $url = 'https://graph.microsoft.com/v1.0/me/messages?$search=&quot;' . $encoded_addresses . '&quot;'; 
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_POST, false);
  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Prefer: outlook.body-content-type=&quot;text&quot;', 'Accept: application/json','Authorization: Bearer '.$account['access_token']));
  $response = curl_exec($ch);
  print_r($response);
  </code></pre>
  <p>One email address (above example) works. But if I pass in more than one email address to the participants parameter, it fails and I get ALL messages in the mailbox retrieved regardless of participants.</p>
  <p>Code example (not working):</p>
  <pre><code>$encoded_addresses = urlencode(&quot;participants:email@domain.com or anotheremail@anotherdomain.com&quot;);
      $url = 'https://graph.microsoft.com/v1.0/me/messages?$search=&quot;' . $encoded_addresses . '&quot;'; 
      $ch = curl_init();
      curl_setopt($ch, CURLOPT_URL, $url);
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
      curl_setopt($ch, CURLOPT_POST, false);
      curl_setopt($ch, CURLOPT_HTTPHEADER, array('Prefer: outlook.body-content-type=&quot;text&quot;', 'Accept: application/json','Authorization: Bearer '.$account['access_token']));
      $response = curl_exec($ch);
      print_r($response);
  </code></pre>
  <p>I’m using PHP and cURL.</p>
  <p>Has anyone managed to search on multiple values? If so with what syntax?</p>
  <p>Note I’m using search and not filter parameter.</p>
  <p>Thanks</p>