Microsoft Graph API Outlook Post not possible

EdEntw 5 Reputation points
2024-07-15T08:35:20.22+00:00

Hello,

We have been making an Outlook calendar entry (event in the shared calendar) via the Microsoft Graph API for some time now. Unfortunately, since today this no longer works, although we have not changed anything.

The error message is POST:

{

    "error": {

        "code": "ErrorInternalServerError",

        "message": "An internal server error occurred. The operation failed."

    }

}

URL: https://graph.microsoft.com/v1.0/{email}/calendars/{id}/events

The body:

{

    "subject": "Test",

    "body": {

        "contentType": "Text",

        "content": "test"

    },

    "start": {

        "dateTime": "2024-08-01T08:00:00",

        "timeZone": "Europe/Berlin"

    },

    "end": {

        "dateTime": "2024-08-02T16:00:00",

        "timeZone": "Europe/Berlin"

    }

}

A GET from the URL works: https://graph.microsoft.com/v1.0/{email}/calendars/{id}/events

but not a POST.

Can you help us?

Outlook
Outlook
A family of Microsoft email and calendar products.
3,973 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,218 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. CharanyaB-MSFT 1,891 Reputation points Microsoft Vendor
    2024-07-15T18:30:54.4733333+00:00

    Hello @EdEntw ,

    Thank you for choosing Microsoft!

    To create an event in the shared calendar try using the POST users/{email}/calendars/{id}/events API, please ensure the user has the necessary permissions to edit the shared calendar.

    The 500 error is a server-side issue that can arise from various factors, such as internal server errors, incorrect API request formats, or problems with the requested resources. If the error is intermittent and the request succeeds upon retry, it might indicate a temporary server issue or a transient network problem. I have successfully created an event in the shared calendar with the required access. You can refer to the screenshot below.

    User's image

    You could wait for some time and then test again. If the issue isn't fixed, try calling the API in the Graph Explorer or Postman with a user who has permission to edit this shared calendar. If the issue persists, I suggest submitting a ticket in the admin center with the request ID and timestamp so you can get detailed error information.

    Documentation reference: https://learn.microsoft.com/en-us/graph/api/calendar-post-events?view=graph-rest-1.0&tabs=http

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".


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.