Azure / Office 365 / SharePoint Development / Search

Get the SharePoint site behind an Office 365 Group via the Microsoft Graph

on Mar 29, 2017 by Elio Struyf with 6 comments

Back in January, I wrote an article about how you could retrieve the site URL of an Office 365 Group.

Linked article: Get the site URL of an Office 365 Group via the Microsoft Graph

The way how I achieved it back then was via calling the drive end-point and parsing the site URL from the response.

While I was testing out something today on the Graph Explorer, I noticed a new SharePoint Group end-point (atm only available on the beta endpoint). This makes it even easier to get the webUrl.

Info: At this moment, I did not find any details yet about the API end-point in the beta documentation, but I am sure that it would not be for long until this is also covered.

The new API endpoint can be called as follows: https://graph.microsoft.com/beta/groups/<group-id>/sharepoint/site

Here is a sample:

Graph explorer example

Graph explorer example

When you only need the webUrl, you just have to call it as follows: https://graph.microsoft.com/beta/groups/<group-id>/sharepoint/site?$select=webUrl

Update

Apparently, Mikael Svenson had already posted this on his blog: Microsoft Graph adds SharePoint endpoint for Groups in the beta branch.

Article comments