Using Microsoft Graph to access Office 365 Group Calendar Events

Iron Contributor

I recently used the Graph API to access the calendar and events from a public Office 365 Group. However, it has stopped working and I have now tried numerous ways to get it working again to no avail, feels like it was just a dream....

The error I get back is:

 

{
  "error": {
    "code": "ErrorNonExistentMailbox",
    "message": "No mailbox was found that includes the external directory object ID that was specified.",
    "innerError": {
      "request-id": "1234567-de44-43d6-8c9d-5fcc10196590",
      "date": "2016-10-01T11:21:10"
    }
  }
} | 

The application has the correct rights to the Microsoft Graph i.e. Groups.Read.All I get a token back from the ADAL authentication, use it as the Bearer. 

 

My URL is 

 

https://graph.microsoft.com/v1.0/groups/<my group id here>/events

 

This returns the response given above, if I remove the events part of the URL I successfully get the group information back.

 

5 Replies

At first glance, that looks correct. I have a sample in the PnP repo that reads group events. There is also an online version at https://office365groupsexplorer.azurewebsites.net. Perhaps you can compare to the sample?

Is it possible the mailbox is hidden from the Global address list?

 

"EWS queries will fail if the mailbox is hidden from the Global Address List"  Not sure in Graph but might be fertile ground to explore.

Hi Terry,

Can you please help me if you have found a solution for this already. Groups are working fine but I get 'ErrorNonExistentMailbox' error when I try to get events using below code,

 

let url = `https://graph.microsoft.com/v1.0/groups/${groupid}/events`;
jQuery.ajax({
url: url,
type: 'GET',
headers: {
'Authorization': 'Bearer ' + token
},
success: function(data) {
console.log(data);
},
error: function(err) {
console.log(err);
}
});

https://graph.microsoft.io/en-us/docs/api-reference/v1.0/api/group_list_events

 

List events

 

Retrieve a list of event objects.

Prerequisites

One of the following scopes is required to execute this API: Group.Read.All or Group.ReadWrite.All

HTTP request

GET /groups/{id}/events
GET /groups/{id}/calendar/events

 

Tried both, still didn't work, this is not beta functionality.