Getting group calendars via Microsoft 365 API - outlook

I'm trying to use the Microsoft Graph API to retrieve an Outlook Group Calendar.
By this, I mean one of the calendars that appears in the "groups" section in Outlook, like in this picture:
However, I can't figure out how to do it.
If I make a request to:
/users/user#domain.com/calendarGroups
I get three groups: My Calendars, Other Calendars and People Calendars.
However, if I then try to list the calendars of each group by calling:
/users/user#domain.com/calendarGroups/calendar_id/calendars
I see that none of them contain the calendars I'm looking for (the ones shown in the screenshot). In fact, the first group contains my personal calendars and the other two are empty.
What am I missing here?

Related

How do I get the memberships (distribution groups) of an Outlook contact programmatically?

Using office Outlook, we can find the 'Memberships' tab when we click and expand a contact, this 'Memberships' tab shows the list of emails that the user is subscribed to.
For example, Employee X (x.x#zcompany.com / id123#zcompany.com) under the Data Department of Z Company is subscribed to the following distribution groups:
datateam#zcompany.com
allemployeees#zcompany.com
dataweekly#zcompany.com
it.uk#zcompany.com
znewsletter#zcompany.com
I would like to get the list of emails the user is subscribed to by inputting either the user's email or user's organization ID.
I found a few potential solutions but do not know exactly how to implement them:
Outlook Interop GetMemberOfList() and GetExchangeDistributionList()
Using Microsoft Graph API
VBA automation for Outlook
Reverse engineering using ExchangePowershell
Using RPA to imitate user actions on Outlook
Wonder if someone with experience doing this can provide some advice? Thanks in advance.
In OOM, call Application.Session.CreateRecipient, Recipient.Resolve, Recipient.AddressEntry.GetExchangeUser(). ExchangeUser exposes GetMemberOfList() method, which returns IAddressEntries object.

Can't get a list owned by me in Google Calendar API

Using Google Calendar API v3 to get the calendar list.
However, some users are not able to retrieve their own owner's calendar.
I tried using the Try this API for CalendarList#list to retrieve it,
but it did not return the owner's calendar.
https://developers.google.com/calendar/v3/reference/calendarList/list
However, if the user specifies calendarId as primary in CalendarList#get,
it can be retrieved successfully.
https://developers.google.com/calendar/v3/reference/calendarList/get
Do you have any advice for me?
Can't get a list owned by me in Google Calendar API
Answer: There is no endpoint which will return a full list of all calendars Owned or that the user simply has access to. As this endpoint does not exist the answer to your question is you cant so its working as intended.
In actually you have misunderstood what the calendarlist is. See below
What is calendarList and how does it work?
The calendarList.List is mealy the list that appears on the bottom left hand side of the UI window. There is no guarantee that a user will have anything in this list as it depends upon how the user added the calendar to the list in the first place. The user could also have deleted it form the list. The UI tends to do it automatically but if it was added programmaticlly it will probably not appear it the users calendarlist. So you should not be relying upon the calendarlist to contain a list of all the calendars a user has access to. please see Events and calendars
All users do however have a primary calendar you can always do calender.get on primary and you will get back the primary calendar for that user.

Microsoft Graph List Contacts API returns contacts beyond what are visible in the Outlook UI

Outlook UI
You can see that I've made three test contacts in the UI accessible here: https://outlook.live.com/people/
Microsoft Graph List Contacts API
When I call the List Contacts API (https://graph.microsoft.com/beta/me/contacts?$orderby=createdDateTime desc&$top=50), I get a list of contacts that is much more extensive than the list visible in the UI. These contacts appear to be anyone that has emailed me or anyone that I've emailed.
The problem
If I want to poll against the GET /me/contacts endpoint to get some data whenever I make a new contact, I'll end up getting notified every time someone new sends me an email or every time I send someone new an email (even if I didn't manually create the contact).
Is this intentional? If so, are there any filters I could add to specify that I don't want to get contacts that were not manually created by me? Looking over the JSON representation of a contact, I don't see anything I can filter on.
Possible Solution
My only thought is that I notice that the contacts made for me exist in a folder that is not returned in the contactFolders API endpoint. I could theoretically make a call to that endpoint and take the list of contacts returned and check if the parentFolderId exists in there. If it does, presumably that's because we created a contact and if not then it's made for us. That feels terribly hacky, though.
Thanks for the help!
This is an issue with the Microsoft Graph Beta APIs. Switching to the v1.0 of the Graph REST APIs resolved this.
It seems Outlook automatically adds every email address that had been in contact with the user as a hidden contact in a hidden folder.
The GET beta/me/contacts endpoint (unlike the v1.0 one) returns all contacts from all folders, so it also includes this hidden folder.
There are two ways to get the expected list of contacts:
Option 1 - get all contacts, and then filter:
GET /beta/me/contactFolders to obtain a list of "real" folders (this endpoint does not return that hidden folder)
GET /beta/me/contacts to get all contacts in the account
Filter the list of contacts by field parentFolderId - to keep only contacts in one of the folders returned at step 1
Option 2 - get contacts by folder:
GET /beta/me/contactFolders to obtain a list of "real" folders (this endpoint does not return that hidden folder)
for each folder returned call GET /beta/me/contactFolders/{folder-id}/contacts and aggregate the returned contact lists
Hope this helps.

How can I subscribe to a Team Calendar comprised of multiple Calendars?

Using Confluence version 4.1.9. The situation is that we have each individual employee with a Team Calendar in order to enter public events (vacation, jury duty, etc.) Further, each 'team' has created a wiki page that contains a calendar that shows all of the team member's calendars, thusly
We would now like to be able to sync that meta-calendar back to Microsoft Outlook, hopefully without having to force each Outlook user to manually add the entire set of calendars in the meta-calendar.
How can I set it up so that Microsoft Outlook users can subscribe to Confluence calendars of this sort?

How get user contacts list from EWS

I'm developing web application which is similar to address-book,
now I want to create a page with list of user contacts. I already have user email and show out_of_office badge using GetUserOOFSettrings API method.
Does the API for getting user's (favorite) contacts list exists?
E.g. to get MS Lync contacts which user have, or outlook contacts...
Does some better way for implementation of current feature exists?
Thanks
Have a look at https://msdn.microsoft.com/EN-US/library/office/jj190895(v=exchg.150).aspx. Contacts are just items in the user's mailbox. You might also download EWSEditor to poke around and see what's available.

Resources