问题
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