简体   繁体   中英

Create groups calendar events fails

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.

Group calendar access is not supported in app-only authorization flow.

We are working on returning a better error for this case.

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,

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM