Thursday, March 16, 2017

Microsoft Graph adds SharePoint endpoint for Groups in the beta branch

I’m calling the Microsoft Graph with Office 365 groups these days and I stumbled upon a new SharePoint endpoint for Groups.

If you call:

https://graph.microsoft.com/beta/groups/821b0970-fae7-4640-bb22-5d091fd17a33/sharepoint/site

you will get the following information back, listing the site name and URL – a better approach compared to using the /drive/root/webUrl endpoint as you don’t have to strip anything.

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#groups('821b0970-fae7-4640-bb22-5d091fd17a33')/sharepoint/site/$entity",
    "createdDateTime": "2017-03-16T16:55:39.19Z",
    "description": "",
    "id": "42d1e3d3-a645-4388-a217-4d88380802df,de4b0a91-5caa-4732-a530-67cfb2b0c42d",
    "lastModifiedDateTime": "2017-03-16T11:00:08Z",
    "name": "project-govtest",
    "webUrl": "https://tenant.sharepoint.com/teams/project-govtest",
    "root": {},
    "siteCollection": {
        "hostname": "tenant.sharepoint.com"
    },
    "siteCollectionId": "42d1e3d3-a645-4388-a217-4d88380802df",
    "siteId": "de4b0a91-5caa-4732-a530-67cfb2b0c42d"
}

If all you want is the url, use /sharepoint/site/webUrl.

1 comment:

  1. Seems the endpoint has been removed for now, so we'll see how it resurfaces.

    ReplyDelete