Using MS Graph to get Calendar for a resource

virginie Marcoux 20 Reputation points
2024-05-07T19:54:03.3366667+00:00

Trying to get Calendar information for a specific users (not Me) but getting error.

Getting user detail:

Query: https://graph.microsoft.com/v1.0/Users/5e28a862-6056-44fc-b8a6-f3cdbdd47fcb

Result : gave me detail about this users without any problem.

Calendars Query
https://graph.microsoft.com/v1.0/Users/5e28a862-6056-44fc-b8a6-f3cdbdd47fcb/Calendars

Error:

"ErrorItemNotFound",
        "message": "The specified object was not found in the store."
Outlook | Windows | Classic Outlook for Windows | For business
Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

Accepted answer
  1. Anonymous
    2024-05-08T05:40:28.28+00:00

    Hi @virginie Marcoux

    You can't retrieve another user's calendar information unless the target user has delegated a calendar to you. According to the Graph API, there are two ways to solve this problem.

    1 The first way is to create an application in the Microsoft Entra ID and grant the application permission Calendars.Read, and finally get a token through the client credentials flow for access.

    2 The second method is the way you are currently using to access another user's calendar through delegated permissions, but this method requires the accessed user to share the calendar with you or delegate it to you.

    For more information about how to share or delegate a calendar:

    https://support.microsoft.com/en-us/office/calendar-delegation-in-outlook-on-the-web-532e6410-ee80-42b5-9b1b-a09345ccef1b#:~:text=1%20In%20Outlook%20on%20the%20web%2C%20select%20Calendar,sent%20to%20you%20and%20your%20...%20See%20More

    For more information about how to get shared or delegated Outlook calendar:

    https://learn.microsoft.com/en-us/graph/outlook-get-shared-events-calendars

    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.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

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.