List events of outlook calendar meeting room by a get request to display in a node app

Rakshya Panta 25 Reputation points
2023-02-24T12:14:38.6133333+00:00

I want to list all the meeting in the meeting room of outlook calendar through a get request in a node application. How is it possible? I tried Microsoft graph API but I cannot get any solutions.

I have registered an app in Azure AD and generated client secret ID also and set permissions as below:

Screenshot from 2023-02-23 12-35-15

Following this tutorial , I dynamically generated access tokens and I am able to list calendars of users, post events. But I cannot get event details of any calendars although permissions are of both Calendar read and write.

I am using https://graph.microsoft.com/v1.0/users/{userId}/events to get events but I cannot access it. It gives 403 error i.e permission error but as mentioned above I think I have enough permissions to read write. I can fetch calendars using /v1.0/users/{userId}/calendars and fetch users using /v1.0/users and post events using /v1.0/users/{userId}/calendars/{calendarId}/events by passing event payload.

But I cannot get events using /v1.0/users/{userId}/events and /v1.0/users/{userId}/calendarview?startDateTime=2023-02-25T13:00:00&endDateTime=2023-02-28T23:00:00.

Microsoft 365 and Office | Development | Office JavaScript API
Microsoft Security | Microsoft Graph
{count} vote

3 answers

Sort by: Most helpful
  1. Shivam Dhiman 6,081 Reputation points
    2023-02-24T23:00:14.7066667+00:00

    Hi @Rakshya Panta

    Based on my observation from previous cases, I will suggest, try to remove & revoke Calendars.ReadBasic.All permission from the specific app and grant the other required permissions again, then execute the Graph API.
    Also, you can decode your token using JWT.IO and see in roles section if you have permission in your token.

    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.

    1 person found this answer helpful.
    0 comments No comments

  2. Rakshya Panta 25 Reputation points
    2023-02-27T06:32:46.25+00:00

    Screenshot from 2023-02-27 12-12-25

    I removed and revoked all unnecessary permissions and only added these two then I was able to get calendar events


  3. CarlZhao-MSFT 46,376 Reputation points
    2023-02-27T07:05:39.8533333+00:00

    Hi @Rakshya Panta

    According to my test, the Calendars.ReadBasic.All application permission will conflict with other calendar permissions, please delete this permission, and only keep the Calendars.Read or Calendars.ReadWrite application permissions.

    User's image

    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 comments No comments

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.