为 Graph API 获取 Office 365 邮件 ID int outlook 或 web

Get Office 365 mail id int outlook or web for Graph API

在 Outlook 中哪里可以找到 MessageId 邮件? 我需要 Id 将其传递给 Graph API,因此 this 不是正确的 ID。

一定是这样的:

AAE3NzVkZTAwLTNiM2MtNGUwNS1iYzNiLTZjNjM0YTc5985zJhZABGAAAAAABKvyNK5HPTSZZiT7al48txBwC12ftoWcMmSKHMBQzQpO
rDAAAAAAEMAAC12ftoWcMmSKHMBQzQKKJAADRLyVbAAA=

我需要这个 Graph -> Message API。

Outlook 使用 EntryID 属性 值来标识商店中的项目。要获得 EwsId,您必须使用以下代码转换它:

string ConvertHexEntryIdToEwsId(ExchangeService esb, string sID, string strSMTPAdd)
{
  AlternateId objAltID = new AlternateId();
  objAltID.Format = IdFormat.HexEntryId;
  objAltID.Mailbox = strSMTPAdd;
  objAltID.UniqueId = sID;

  AlternateIdBase objAltIDBase = esb.ConvertId(objAltID, IdFormat.EwsId);
  AlternateId objAltIDResp = (AlternateId)objAltIDBase;
  return objAltIDResp.UniqueId;
}

但我建议使用 Convert Outlook REST API item id to MAPI EntryID 页面上描述的方法:

if you wanted to fetch a page of your messages and include the PR_ENTRYID, you could make a GET request to:

https://graph.microsoft.com/v1.0/me/messages?$expand=singleValueExtendedProperties($filter=id%20eq%20'Binary%200x0FFF')