Patch request not updating data

Stephen Ignatius 20 Reputation points
2024-04-01T19:45:56.2233333+00:00

I am trying to send a patch request and update my calendar using this API call in my code.

  const calendarsResponse = await axios.patch(
    `https://graph.microsoft.com/v1.0/me/calendars/${calendarId}`,
    updatedCalendarData,
    {
      headers: {
        Authorization: `Bearer ${account.accessToken}`,
        'Content-Type': 'application/json',
      },
    },
  );
  return calendarsResponse.data;

I got a 200 response however, the calendar is not updating. This is my postman result.

sniping msc

Other CRUD endpoints work fine, like POST and GET calendars but this PATCH method does not seem to update the calendar details even though it returns a successful error code.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,409 questions
JavaScript API
JavaScript API
An Office service that supports add-ins to interact with objects in Office client applications.
942 questions
Outlook Management
Outlook Management
Outlook: A family of Microsoft email and calendar products.Management: The act or process of organizing, handling, directing or controlling something.
5,068 questions
0 comments No comments
{count} votes

Accepted answer
  1. CarlZhao-MSFT 40,226 Reputation points
    2024-04-02T08:38:47.43+00:00

    Hi @STEPHEN IGNATIUS

    It works fine for me. Try logging your user into Graph Explorer and calling PATCH https://graph.microsoft.com/v1.0/me/calendars/{id} endpoint.

    User's image

    BTW, there is no carlendarName property, only name property.

    Hope this helps.

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


0 additional answers

Sort by: Most helpful