将 Outlook REST API 项目 ID 转换为 MAPI EntryID [英] Convert Outlook REST API item id to MAPI EntryID

查看:31
本文介绍了将 Outlook REST API 项目 ID 转换为 MAPI EntryID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有官方支持的方法将 Outlook REST API 中的项目 ID 转换为 MAPI EntryID?

is there an officially supported way to convert item ids from the Outlook REST API into an MAPI EntryID?

我说的是在邮箱端点上为 http GET 的 json 响应中的项目返回的Id"字段,如下所示:

I am talking about the "Id" field returned for items in the json response of an http GET on a mailbox endpoint like so:

https://outlook.office365.com/api/v2.0/我/消息

Id 字段包含一个 base64 值.当我将其转换为十六进制并将其与同一项目的 PR_ENTRY_ID 值进行比较时,例如使用 MFCMAPI,我可以发现 EntryID 包含在 Id 字段的十六进制版本中.

The Id field contains a base64 value. When I convert it to hex and compare it to the PR_ENTRY_ID value of the same item, e.g. with MFCMAPI, I can find the EntryID is contained in the hex version of the Id field.

是否有官方文档说明如何在 id 格式之间进行转换?

Is there an official documentation how to convert between the id formats?

还是要调用的 API?更喜欢本地转换函数以避免额外的 REST 往返.

Or an API to call? Would prefer a local convert functions to avoid additional REST roundtrips.

感谢您的任何提示斯文C

Thanks for any hints SvenC

推荐答案

您对 Microsoft Graph API 的查询可以指定您希望包含 PR_ENTRYID 或其他 MAPI 属性.这是官方文档 用于 Microsoft 的 singleValueLegacyExtendedProperty.

Your query to the Microsoft Graph API can specify that you would like to include the PR_ENTRYID or other MAPI properties. Here is the official documentation for singleValueLegacyExtendedProperty from Microsoft.

例如,如果您想获取一页消息并包含 PR_ENTRYID,您可以发出 GET 请求以:

For example, 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')

没有 URL 编码,$expand 语句如下:$expand=singleValueExtendedProperties($filter=id eq 'Binary 0x0FFF')

Without URL encoding, the $expand statement reads: $expand=singleValueExtendedProperties($filter=id eq 'Binary 0x0FFF')

有三种有效的语法可以过滤 MAPI 属性:

There are three valid syntaxes to filter for MAPI properties:

  1. 'MapiPropertyType namespaceGuid Name propertyName'
  2. 'MapiPropertyType namespaceGuid Id propertyId'
  3. 'MapiPropertyType propertyTag'

请注意,上面的示例使用 #3,并且根据 [MS-OXPROPS] Exchange 服务器协议主属性列表.

Note that the example above uses #3, and that 0x0FFF is the propertyTag for PR_ENTRYID per the [MS-OXPROPS] Exchange Server Protocols Master Property List.

这篇关于将 Outlook REST API 项目 ID 转换为 MAPI EntryID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆