Get shared O365 calendars with Graph API - microsoft-graph-api

I need to get information (events and tasks) about shared calendars with Graph API.
In my Office365 account, I have several shared calendars ( calendars that other people have shared with me ) and I have any kind of privileges on those: from the client or from the browser I can read/write appointments and task. So I don't understand why I can't retrieve information about those shared calendars with Graph API. I tried
https://graph.microsoft.com/v1.0/me/calendars
but I get only my personal calendars, and
https://graph.microsoft.com/beta/me/calendarGroups/{shared-calendar-group-id}/calendars
but I get an empty response.
Can someone help me?

Get shared calendars
https://graph.microsoft.com/v1.0/users('user id who shared the calendar to you')/calendars
official guidline

Related

Failed to list all calendars with microsoft graph api

I'm currently trying to deal with calendars using graph api.
Last week, I've tried to use
https://graph.microsoft.com/v1.0/users/{user_id}/calendars
and
https://graph.microsoft.com/v1.0/users/{user_id}/calendars?$top=500
to list the calendars from my_calendar groups.
However, only the calendars I've created months ago can be listed, and all the calendars I create today are not listed. (there are only 15 calendars)
Note. I've tried to use
UI: https://outlook.office.com/calendar/view/month
graph explorer sending api: post https://graph.microsoft.com/v1.0/users/{user_id}/calendars
to create the calendar.
However, all the new calendars I create can not be listed by the list calendars api.
Best regards,
Thank you in advance~!
List calendars - Get all the user's calendars (/calendars navigation property), get the calendars from the default calendar group or from a specific calendar group.
For getting delegated shared calendars, use this documentation.

Shared calendars through Microsoft Graph

I'm viewing shared calendars in my app. It uses delegated workflow with permission Calendar.Read.Shared and Users.ReadBasic.All
I don't really understand how to sharing works when it comes to the API
Some users shared calendars are not shown when accessing /users/{userId}/calendars (they are visible in outlook)
Some users calendars are returned when using /users/{userId}/calendars but when trying to access the calendar events I get 403. Why are the calendar available to access but not the events? (they are visible in outlook).
I'm able to get both calendars and event in some cases
I'm guessing there are some settings on the calendars themselves that make this difference but I'm not able to see the difference in the calendar object I get from the /users/{userId}/calendars response or from the calendars when I view them in outlook.
I have verified the behaviour in Graph Explorer so it is not code related.
Is there another way to access all shared calendars?

Microsoft Graph API: Is there a way to get the user's acitivity feed of teams?

We want to get the number of acitivities for a user, which is also shown as badge in the teams app.
I didn't found any direct way. Does anyone found a way to achieve this indirectly?
There is no such way to get all the activity of an user in Teams.
You can look into Subscription Graph API. It allows a client app to receive change notifications about changes to data in Microsoft Graph. Currently, subscriptions are enabled for the following resources:
An alert from the Microsoft Graph Security API
A conversation in an Office 365 group
Content in the hierarchy of a root folder driveItem
in OneDrive for Business, or of a root folder or subfolder driveItem
in a user's personal OneDrive
A list under a SharePoint site
A message, event, or contact in Outlook
A user or group in Azure Active Directory
See Use the Microsoft Graph API to get change notifications for the possible resource path values for each supported resource.

How to Access Calendar Appointments of Other Users using Microsoft Graph

How can I access other users calendar appointments in MS Outlook to validate if the appointment time created in our application are already taken. We have an account to access MS Graph APIs.
As per further research, MS Graph requires delegation and sharing to enable access to other users' calendar. No other workaround.

Microsoft Graph API: Can we read multiple users calendar events using one Microsoft account within an organization or team

I am trying to find a way to read calendar events of my team and can schedule something based on everyone's availability.
I was able to fetch my calendar events successfully. But I am curious if we can get details of calendar events of my colleagues within my team or organization.
Is there a way we can achieve this?
If yes, it would be helpful if anyone can share some insights on this.
Thank you in advance.
If you grant the app permissions to read calendars from all users, then you can achieve what you want.
Then, you can get the list of users IDs from /users.
Using the IDs, you can retrieve the user calendars. If you only desire the available times in a scheduling assistant way, then you can use the Find Meeting Times API also.

Resources