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 365 and Office | Development | Office JavaScript API
Outlook | Windows | Classic Outlook for Windows | For business
Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

Answer accepted by question author
  1. CarlZhao-MSFT 46,411 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

Your answer

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