Reputation: 119
POST https://graph.microsoft.com/v1.0/groups/4a3c5f77-463e-XXXXXX-fa8XXXXXX/calendar/events
Accept: application/json
Authorization: Bearer <Token>
Content-Type: application/json; charset=utf-8
{
"originalStartTimeZone": "UTC",
"originalEndTimeZone": "UTC",
"start": {
"dateTime": "2015-12-03T09:30:00-00:00",
"timeZone": "UTC"
},
"end": {
"dateTime": "2015-12-03T10:30:00-00:00",
"timeZone": "UTC"
},
"responseStatus": {
"response": "Accepted",
"time": "2015-12-01T18:34:00-08:00"
},
"reminderMinutesBeforeStart": 15,
"isReminderOn": true
}
Error:
{
"error": {
"code": "ErrorInternalServerError",
"message": "The SMTP address has no mailbox associated with it.",
"innerError": {
"request-id": "f62423b0-0ade-494d-8c8c-1b56db60b524",
"date": "2015-12-02T10:39:44"
}
}
}
I have tried with both post url mentioned below,
POST /groups/<id>/events
POST /groups/<id>/calendar/events
I have tried with different group types which include security enabled, mail-enabled and Unified Groups but I am seeing the same error message, any help would be appreciated.
Upvotes: 7
Views: 904
Reputation: 1704
Group calendar access is not supported in app-only authorization flow.
We are working on returning a better error for this case.
Upvotes: 4
Reputation: 5838
I believe that you will get this error for security groups or mail-enabled security groups. This will ONLY work for Unified (O365) groups. Only those types of group have content associated with them. To ensure you are creating a unified group correctly, here's the request and payload of a typical request:
POST https://graph.microsoft.com/v1.0/groups
{
"description":"Group 5bff4 is the best ever",
"displayName":"Unified group 5bff4",
"groupTypes":["Unified"],
"mailEnabled":true,
"mailNickname":"Group5bff4",
"securityEnabled":false
}
Then your request to ../groups//events should work. NOTE: creation of the underlying group mailbox may take a few seconds (something we are working to improve), so creation of the event directly after group creation may fail.
Hope this helps,
Upvotes: 3