Get event using Microsoft Graph: ErrorAccessDenied

fomplus_graph 40 Reputation points
2023-02-07T13:49:37.2166667+00:00

0

Following the instructions from: learn.microsoft.com/en-us/graph/api/event-get , to get all of the details of an specific successfully created event.

I am executing this HTTPS GET request with the URI: graph.microsoft.com/v1.0/users/{user_id}/calendars/{calendar_id}/events/{event_id}

With header: {"Authorization": "Bearer {token}"}

No request body added

I get the following error in the response using postman:

{
    "error": {
        "code": "ErrorAccessDenied",
        "message": "Access is denied. Check credentials and try again."
    }
}

With status: 403 Forbidden

I'm sure the token is valid, checked on: jwt.ms

Every id is valid as well, checked multiple times on graph explorer

The Roles inside the claim of my token are: OnlineMeetings.Read.All, Mail.ReadWrite, OnlineMeetings.ReadWrite.All, OnlineMeetingArtifact.Read.All, Calendars.Read,Mail.ReadBasic.All, Calendars.ReadBasic.All,Mail.Read, ExternalItem.Read.All, Calendars.ReadWrite, Mail.Send,Mail.ReadBasic.

I have also consented to all of the previous roles as Application and delegated permissions (if possible) with granted status.

I get the same error on graph explorer using the uri: graph.microsoft.com/v1.0/me/events/{event_id}

I would much appreciate any assistance.

UPDATE 1:

I forgot to add to my original post that i have already consented Calendar.Read & Calendar.ReadWrite on Graph Explorer.

Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Gopinath Chennamadhavuni 2,446 Reputation points
    2023-02-07T14:52:29.2566667+00:00

    Hi @fomplus_graph ,

    Based on my observation from previous cases, I will suggest, try to remove & revoke all permission of the specific app and grant the required permissions again, then execute the Graph API.

    Please let me know if you are still facing this issue.

    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.

  2. CarlZhao-MSFT 46,406 Reputation points
    2023-02-08T03:28:52.5+00:00

    Hi @fomplus_graph

    According to my tests, as long as you have Calendars.Read application permissions, you should be able to get calendar events of the other users in the tenant. So for ease of testing, create a new application and grant Calendars.Read application permissions, and then grant admin consent. Finally, use the client credentials flow to get a token and call this endpoint:

    User's image

    Similarly, if you want to get your own calendar events in the Graph Explorer tool, you need to consent to the appropriate permissions:

    22


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


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.