Shared calendars through Microsoft Graph - microsoft-graph-api

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?

Related

Is it possible to get all events from all calendars regardless of calendar group

I want to use a Graph request to pull all events from all calendars regardless of a calendar group. What I have tried:
GET /me/calendar/events
GET /me/calendarGroups/{id}/calendars/{id}/events
Case one I get from one calendar from the default calendar.
case two I get from a specific calendar in any group.
Any way of getting events from all calendars everywhere?
To get all events from all user's calendars you can use Client Credential flow which gives App only token and use it to query all calendars using below call
https://graph.microsoft.com/v1.0/users/userid/calendars
and then use the calendarid's and pull the events by using the below call for each calendar_id.
https://graph.microsoft.com/v1.0/users/1ab4e76f-5f52-44b8-8a72-7d03c05e6ff4/calendars/AAMkAGI0Mjk2NTQ5LTE4MjctNDE1Yy04Nzc0LWIxNzA0MDBkNDkwZABGAAAAAABAJhtsoNeXR49KeByGVNbsBwB0tR3-uC1cSqrKkE00IGLeAAAAAAEGAAB0tR3-uC1cSqrKkE00IGLeAAAAAB89AAA=/events
There is no direct call to get all events from all the calendars as of now. There is already a feature request raised in the Microsoft Graph Feature Request Forum, please upvote it so that it may be implemented in the future.

Get shared O365 calendars with 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

How to ADD/EDIT/DELETE events in ICLOUD calendar using CALDAV

I am implementing a new functionality to manage events in ICLOUD calendar(includes my own calendar as well as other ICLOUD users calendar).I successfully implemented the functionality with CALDAV, but here I wanted to know is there any better approach to do the same.
Below mentioned steps will explain how I achieved ADD/EDIT/DELETE functionality with CALDAV in other ICLOUD users calendar.
otheruser#gmail.com :icloud account of a user who shares his calendar with me
myaccount#gmail.com: referring to my icloud account
otheruser#gmail.com will share his/her calendar with myaccount#gmail.com
Once i accept the request this calendar will be listed in myaccount#gmail.com
Using below CALDAV api I will get all calendars listed in my account
From the response of above request I will get each calendar url and perform add/edit/delete action accordingly.
Note:Here one drawback is I need to ask each user of my application to share(but sharing it private not as public) his personal calendar with my account.
I am using c# as it is a .net application.
Any help would be appreciated.Thanks in advance.
The question is quite broad so it is hard to really figure out what you are looking for.
In any case one thing about your PROPFIND request: You should also ask for the DAV:resourcetype property (defined in https://www.rfc-editor.org/rfc/rfc4918#section-15.9) and, in your response, only consider the ones that have a calendar value in their resource type (see https://www.rfc-editor.org/rfc/rfc4791#section-4.2).

Sharing a calendar with another user via the Microsoft Graph API

I'm working on an application that does OAuth authorization on behalf of multiple users. My application wants to be able to create a calendar for user A and then share that calendar as read only to user B. It will then create events on that calendar so that they appear for user A as read/write and for user B as read only.
Obviously the Microsoft Graph API supports creating a calendar and putting events on it. My question pertains to the sharing part.
Does the Microsoft Graph API (or the Outlook 365 REST API) support sharing a calendar from one user to another user? I wouldn't want user B to receive the typical email that announces that user A shared a calendar with them. After creating the calendar under user A's account, I'd want to use user A's credentials to set up the sharing permission to user B. Then I would use user B's credentials to add the shared calendar to their list of calendars so that they see it in the Outlook 365 calendar interface.
I've read through a lot of the documentation and have been playing around with a prototype, but I can't find where this use case is supported.
I'm afraid this isn't possible to do via Microsoft Graph. The scenario seems reasonably straight forward, I recommend visiting the UserVoice and adding this suggestion.

Non-editing author permissions Google Calendar

I have a web application that allows users to sign in with their Google Account and create events on a Google Calendar. However, I only want one specific user to edit/delete already existing events in the calendar and all other users should only be able to add events to the Calendar.
A permission similar to this exists on Outlook, which has a permission called Non-editing author. Is the same available for Google Calendar?
both the events.insert and the events.update / events.patch require the scope of
https://www.googleapis.com/auth/calendar read/write access to Calendars
Which technically gives a user access to read and write to any part of the calendar not just the events. Your application is going to have to limit access the calendar api does not give you this ability.

Resources