Got an error (500) "The attachment could not be opened" when downloading attachments from Calendar

CAT 41 Reputation points
2024-09-20T01:59:55.85+00:00

We got an error "The attachment could not be opened" (status code= 500) when downloading some events' attachments.

We developed a script to download all events' attachments through graph api.

Here's what we did:

  1. Use /events/{id}?$expand=attachment(select=id) to get events' metadatas and attachments' ids
  2. Use /events/{id}/attachments/{id}/values to download attachments

However, we got an internal server error(500) "The attachment could not be opened" for some attachments in step 2

It looks like these attachments were deleted but the metadata still existed

We also find that this issue occurs on EWS api.

Is there any information can help us to find the root cause

Microsoft Exchange Online
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,988 questions
Exchange Server Development
Exchange Server Development
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Development: The process of researching, productizing, and refining new or existing technologies.
544 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.