Microsoft图如何检索Office 365电子邮件的所有SingleValueLegacyExtendedProperties

时间:2019-12-05 22:47:16

标签: c# microsoft-graph outlook-restapi

我能够添加SingleValueLegacyExtendedProperties,并通过按ID进行过滤来检索属性。 但是.Expand("singleValueExtendedProperties")总是在singleValueExtendedProperties=null

中返回Microsoft.Graph.Message

我正在尝试对Outlook发送“使用投票按钮”的方式进行反向工程。我的印象是“投票按钮”信息以SingleValueLegacyExtendedProperties的形式发送,但我无法在不知道ID的情况下看到任何SingleValueLegacyExtendedProperties。

1 个答案:

答案 0 :(得分:0)

您必须指定所需的属性。但是,您可以检索投票选项和投票响应。下面的示例假设您有一个有效的不记名令牌,并在 Windows cmd 窗口中为带有投票按钮或投票响应的消息设置了 folderId 和 messageId 变量。

投票选项以 Base64 字符串的形式提供,使用以下内容对来自 Exchange 的投票结构的字节进行编码:

curl -v -s -H "Authorization: Bearer %token%" "https://graph.microsoft.com/v1.0/users/Non-Prod_Timesheet_Assistant@calpers.ca.gov/mailFolders/%folderId%/messages/%messageId%?expand=singleValueExtendedProperties($filter=id%20eq%20'Binary%20{00062008-0000-0000-C000-000000000046}%20Id%200x00008520')"

其中 0x00008520 来自投票选项的文档: https://docs.microsoft.com/en-us/office/client-developer/outlook/mapi/pidlidverbstream-canonical-property

同样,投票响应可以读作 Unicode 字符串:

curl -v -s -H "Authorization: Bearer %token%" "https://graph.microsoft.com/v1.0/users/Non-Prod_Timesheet_Assistant@calpers.ca.gov/mailFolders/%folderId%/messages/%messageId%?expand=singleValueExtendedProperties($filter=id%20eq%20'String%20{00062008-0000-0000-C000-000000000046}%20Id%200x00008524')"

其中 ID 0x00008524 来自响应文档: https://docs.microsoft.com/el-gr/office/client-developer/outlook/mapi/pidlidverbresponse-canonical-property

在这两种情况下,属性都来自 PSETID_Common 属性集,其 GUID 为 00062008-0000-0000-C000-000000000046。 https://docs.microsoft.com/en-us/openspecs/exchange_server_protocols/ms-oxprops/e11cc753-cecf-4fdc-bec7-23304d12388a