将Outlook REST API项目ID转换为MAPI EntryID [英] Convert Outlook REST API item id to MAPI EntryID
问题描述
是否有一种正式支持的方法将项目ID从Outlook REST
API转换为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 /me/messages
Id字段包含base64值.当我将其转换为十六进制并将其与相同项目的PR_ENTRY_ID
值进行比较时,例如使用MFCMAPI
,我可以找到ID字段的十六进制版本中包含的EntryID.
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.
感谢您的任何提示 SvenC
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:
-
'MapiPropertyType namespaceGuid Name propertyName'
-
'MapiPropertyType namespaceGuid Id propertyId'
-
'MapiPropertyType propertyTag'
'MapiPropertyType namespaceGuid Name propertyName'
'MapiPropertyType namespaceGuid Id propertyId'
'MapiPropertyType propertyTag'
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屋!