title: How do I get a usable email message reference id from headers to use in a Microsoft Graph query?
body: <p>I am trying to use the references message ID in email headers of a forwarded email in Office 365 to then find the original email that has that message ID.</p>
  
  <p>The references ID in the forwarded email's headers would show something like what's shown below. Note I'm obtaining these headers from Microsoft Graph by adding <code>&amp;$select=internetMessageHeaders</code> to my query using sender/subject to find the forwarded email.</p>
  
  <pre><code>{
    "name": "References",
    "value": "&lt;CAOLK2SAEzvs=-6Rs5cTbgORNivQVK2AvMJDJT8o+ghx-XhCn7w@mail.gmail.com&gt;"
  }
  </code></pre>
  
  <p>However, if I take this and use it in a query like <code>https://graph.microsoft.com/v1.0/me/messages?$filter=internetMessageId eq '&lt;CAOLK2SAEzvs=-6Rs5cTbgORNivQVK2AvMJDJT8o+ghx-XhCn7w@mail.gmail.com&gt;'</code></p>
  
  <p>I do not receive any results.</p>
  
  <p>If I hunt down the original email in Microsoft Graph using sender and subject, I see the following for the <code>internetMessageId</code> field for the original email:</p>
  
  <pre><code>{
    "name": "Message-ID",
    "value": "&lt;CAOLK2SC6s9Me05kYRqeuEHKK8DrQbXx34ScT0AzGOFFLMdRapg@mail.gmail.com&gt;"
  }
  </code></pre>
  
  <p>Does anyone have any ideas on what Office 365 or Microsoft Graph is doing to change <code>CAOLK2SAEzvs=-6Rs5cTbgORNivQVK2AvMJDJT8o+ghx-XhCn7w</code> into <code>CAOLK2SC6s9Me05kYRqeuEHKK8DrQbXx34ScT0AzGOFFLMdRapg</code>? It looks like some sort of encoding, but I haven't been able to reproduce it.</p>
  
  <p>Ultimately I would like to be able to transform what I'm getting in the references ID header such that I can turn around and use that ID to find the original email using Microsoft Graph.</p>