如何检索 eventMessage 的事件 [英] How do I retrieve the event for an eventMessage
问题描述
Graph API v1.0 文档指出 eventMessage
资源类型有一个名为 event
的关系,它应该返回
The Graph API v1.0 documentation states that the eventMessage
resource type has a relationship called event
, which should return
与事件消息关联的事件.
The event associated with the event message.
这里有完整的文档:
我会将此解释为使用如下 URL 请求资源的能力:
I would interpret this as the ability to request a resource with a URL such as the following:
https://graph.microsoft.com/v1.0/me/messages/<message id>/event
与访问附件关系的方式相同,即
in the same way that the attachments relationship can be accessed i.e.
https://graph.microsoft.com/v1.0/me/messages/<message id>/attachments
但是,这似乎不起作用.相反,我在响应中收到以下错误:
However, this does not appear to work. Instead I get the following error in the response:
{
"error": {
"code": "BadRequest",
"message": "Resource not found for the segment 'event'.",
"innerError": {
"request-id": "f3203560-0e35-4575-a34c-2a2a884f551a",
"date": "2016-07-13T09:58:58"
}
}
}
我是否发送了错误的请求?文档有错吗?有bug吗?
Am I sending the wrong request? Is the documentation wrong? Is there a bug?
希望有人能澄清一下,提前谢谢!
Hopefully someone can clarify, thanks in advance!
推荐答案
目前只能通过 URL 中的 $expand
参数访问 event
属性.所以你可以这样做:
Currently you can only access the event
property via the $expand
parameter in the URL. So you could do something like:
https://graph.microsoft.com/v1.0/me/messages/<message id>/?expand=
Microsoft.Graph.EventMessage/Event
或者,如果您使用的是 Outlook API 端点,例如:
Or if you're using the Outlook API endpoint, something like:
https://outlook.office.com/api/v2.0/me/messages/<message id>/?expand=
Microsoft.OutlookServices.EventMessage/Event
我们的路线图上有简化这一点,但这是目前的工作方式.
It is on our roadmap to simplify this, but this is the way it works for now.
这篇关于如何检索 eventMessage 的事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!