Fetching calendar events from users

SupportIPD 21 Reputation points
2022-10-06T11:25:36.247+00:00

Hi,

We am trying to read the calendar events of all users with an enterprise app with admin consent but i am getting a ErrorItemNotFound error.

The following permissions are granted on application level:

  • Calendars.Read
  • User.ReadBasic.All

We are using graph V1.0 and Oauth 2.0 to call /users/{userId}/calendar/events.
Using the graph explorer i am getting the same error.

When i call /users or /me/calendar/events it works fine.

What am i missing?
Could it be because the app wasn't verified?

Full error:

   GraphError {  
     statusCode: 404,  
     code: 'ErrorItemNotFound',  
     message: 'The specified object was not found in the store.',  
     requestId: '7045e26f-5bb8-461f-be3e-d5b0f1b174fd',  
     date: 2022-10-06T08:59:13.000Z,  
     body: '{"code":"ErrorItemNotFound","message":"The specified object was not found in the store.","innerError":{"date":"2022-10-06T10:59:13","request-id":"7045e26f-5bb8-461f-be3e-d5b0f1b174fd","client-request-id":"e260ceae-17c4-37f6-02ac-f53dd15ed527"}}'  
   }  
Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

Accepted answer
  1. CarlZhao-MSFT 46,376 Reputation points
    2022-10-07T08:00:14.057+00:00

    Hi @SupportIPD

    Make sure that your app has been granted the Calendars.Read application permission.

    248435-page5.png

    Get a token:

    248413-page6.png

    Call the API endpoint:

    248397-page7.png


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    2 people found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. HarmeetSingh7172 4,826 Reputation points
    2022-10-06T18:04:51.043+00:00

    Hi @SupportIPD

    Hope you're doing well.

    Graph Explorer can test endpoints which works with delegate permissions only i.e., you can get your calendar events using this way.

    For getting other user's calendar events, please use users/{user-id}/calendar/events endpoint in Postman application along with right Application Permissions in your Azure Application.

    Refer: Get Calendar Events: Graph API

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further 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.