Microsoft graph calendar | GET other users calendar

1k Views Asked by At

I have one problem, we have one profile (Call Agent) in our app that can create another agent appointment with clients, so when he adding it should add-in that one agent calendar ( Microsoft /outlook Calendar ),

Basically, one profile can create events in other users calendar

I can get lists of users on API call /users and /users/:ID

but when i try /users/:id/calendar or /users/:id/calendar/events sometimes i get

403 Frobiden ("Access is denied. Check credentials and try again.),

sometimes I get 404 not found but I clearly see that user in the list that I mentioned before

Here is API permission that I currently use for this

API Permisions

I use Angular with MSAL(@microsoft/microsoft-graph-client) library

Do I need Admin Consent, I try to get that but I didn't succeed, so if anyone can help with this that would be perfect :D I stuck with this whole past week.

1

There are 1 best solutions below

0
On

How is your app authenticating? if a user is logging into the app, and you are passing user's token to the graph api, then only the delegated permissions matter. if your app is using its own clientid and getting token based on itself, then you are using application permissions, but that means anyone using the app would potentially have the ability to modify all calendars. usually application auth is reserved for daemons or automated processes or admin processes.

So assuming this is a user logging into the app, then the user itself must have permissions to access other users' calendars, just giving a delegated permission for graph api does not give the user access to that data. it only lets them call that endpoint. This means the user must be given permissions to access other calendars in exchange, or you must share the calendar of all the user calendars you want that user to have access to.