Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I retrieve the event for an eventMessage

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!

like image 847
eggm0n Avatar asked Oct 16 '25 04:10

eggm0n


1 Answers

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.

like image 130
Jason Johnston Avatar answered Oct 17 '25 18:10

Jason Johnston



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!