Last week at Ignite it was announced that finally Microsoft was bringing O365 SharePoint access to the Microsoft graph as an API. This is a huge deal for those of us who want to use O365 as a platform and develop engaging applications for customers. In my case for Office Add-ins this is great because it reduced the number of OAuth hoops I have to jump through and manage to get the data I want.
Here is a link to the documentation: Working with SharePoint sites in Microsoft Graph and a quick example.
NOTE: this is beta and will change – this is purely a demonstration of what is possible today (Oct 2016) and not to be used as future reference.
Example
Using the graph explorer demo I am able to bring up content from my default SharePoint site very easily
https://graph.microsoft.io/en-us/graph-explorer#
Here is my copper site within my SharePoint tenant
and here it is referenced from the graph API
https://graph.microsoft.com/beta/sharepoint/sites/site-id
here is the API response of the lists
https://graph.microsoft.com/beta/sharepoint/sites/site-id/lists
and here is a reference to the documents in the Shared Documents folder
https://graph.microsoft.com/beta/sharepoint/sites/site-id/lists/list-id/items
How cool is that !!!!!