/ Insights / Using the Graph API with SharePoint Insights Using the Graph API with SharePoint November 13, 2018 ConcurrencyUsing the Graph API with SharePoint The Graph API provides access to SharePoint items such as site collections, lists, document libraries and files. See the article https://www.concurrency.com/blog/november-2018/authenticate-to-the-graph-api-as-a-service for a walkthrough on retrieval of an access token needed to use the Graph API.Site CollectionsOnce authenticated to the Graph API it’s possible to retrieve the site collections for the logged in account using the url https://graph.microsoft.com/v1.0/sites?search=*The results will contain an array of metadata for each site collection.The key field is id, this id is in the form of <hostname>, <site collection GUID>,<site GUID> and will allow you to address that site collection directly.If we then substitute that id string into the url https://graph.microsoft.com/v1.0/sites/<id>we can get the metadata for that site. For the remaining examples we will use <id> as a placeholder for the site collection id from the previous query.Siteshttps://graph.microsoft.com/v1.0/sites/<id> returns the metadata for the root site of the site collectionhttps://graph.microsoft.com/v1.0/sites/<id>/sites returns the list of subsites for a given site collection List ElementsLists https://graph.microsoft.com/v1.0/sites/<id>/lists retrieves the lists for the site. The List Name element in the following urls is the display name field, not the name field.List metadatahttps://graph.microsoft.com/v1.0/sites/<id>/lists/<ListName> retrieves the metadata for that listList Itemshttps://graph.microsoft.com/v1.0/sites/<id>/lists/<ListName>/items retrieves the items from the list.List Itemhttps://graph.microsoft.com/v1.0/sites/<id>/lists/<ListName>/items/<ItemId>. The item ID is from the List Item metadata and is a number.Document LibrariesThe Library Name is the Display Name of the Library.The item ID is from the item metadata and looks like: 01ISO65YJFGX6MUL7F25D23LGBAY53O7YK, this id is unique to the document library and will span folders.Library Root Folderhttps://graph.microsoft.com/v1.0/sites/<id>/lists/<LibraryName>/drive/root to get the root folder of the document library.Library Itemshttps://graph.microsoft.com/v1.0/sites/<id>/lists/<LibraryName>/drive/root/children to get the root folder document metadata items.Library Item metadatahttps://graph.microsoft.com/v1.0/sites/<id>/lists/<LibraryName>/drive/items/<ItemId> to get the individual item metadataLibrary Item Contents https://graph.microsoft.com/v1.0/sites/<id>/lists/<LibraryName>/drive/items/<ItemId>/content to get the individual item bytesLibrary Foldershttps://graph.microsoft.com/v1.0/sites/<id>/lists/<LibraryName>/drive/root/children/<FolderPath>/children to get the folder contents Microsoft Graph ExplorerUse the Microsoft Graph Explorer to quickly browse the Graph API to discover the urls and properties available. https://developer.microsoft.com/en-us/graph/graph-explorer