How do I retrieve the event for an eventMessage

为君一笑 提交于 2019-12-07 18:59:50

问题


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.

Full docs here:

eventMessage resource type

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"
        }
    }
}

Am I sending the wrong request? Is the documentation wrong? Is there a bug?

Hopefully someone can clarify, thanks in advance!


回答1:


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

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.



来源:https://stackoverflow.com/questions/38348539/how-do-i-retrieve-the-event-for-an-eventmessage

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!