2

The add attachment endpoint seems buggy. Files attached to a calendar event are not visible to the calendar recipients. The attachments are visible to the event creator. My code had been working for months until recently, which leads me to believe this is a regression.

Steps to reproduce

  1. There must be two users - the creator and the recipient.
  2. Create an event via https://graph.microsoft.com/v1.0/me/calendars/{calendarId}/events
  3. Attach a file to the event via https://graph.microsoft.com/v1.0/me/calendars/{calendarId}/events/{eventId}/attachments
  4. Go to the Office 365 web UI as the creator. The event looks good and includes the attachment.
  5. Query the Microsoft graph API as the creator. The event looks good. hasAttachments is true and listing the attachments via the API works as expected.
  6. Go to the Office 365 web UI as the recipient. The event is missing the attachment (everything else about the event is accurate).
  7. Query the Microsoft graph API as the recipient. hasAttachments is false and you can not list the attachments with the graph API. To get the recipient's event ID, I queried the /calendarView endpoint. It returns a different event id than the event in step 4, but the rest of the object matches (iCalUId, subject, start/end times, etc)...with the exception of hasAttachments.

Fixes attempted

I tried creating the event and attaching the file via the /users/{userId} endpoints instead of the /me endpoints with the same results.

I also tried the add attachment beta endpoint but received the following error:

{
  "error": {
    "code": "NavigationNotSupported",
    "message": "Recursive navigation is not allowed after property 'Events' according to the entity schema.",
    "innerError": {
      "request-id": “{uuid}”,
      "date": "2018-06-06T06:28:47"
    }
  }
}
Marc LaFleur
  • 31,987
  • 4
  • 37
  • 63
Alexander Soto
  • 395
  • 2
  • 12

1 Answers1

2

Marc's workaround fixes the issue - add the attendees after the attachments. A working flow looks like:

  1. Create an event (excluding attendees) via POST to https://graph.microsoft.com/v1.0/me/calendars/{calendarId}/events.
  2. Attach a file to the event via POST to https://graph.microsoft.com/v1.0/me/calendars/{calendarId}/events/{eventId}/attachments
  3. Update the event from step 1 with the attendees via PATCH to https://graph.microsoft.com/v1.0/me/calendars/{calendarId}/events/{eventId}

A few extra requests, but it gets the job done.

Alexander Soto
  • 395
  • 2
  • 12