I'm hoping I can list and add folders and files to a specific Office 365 SharePoint site using Office 365 client API. (NOTE - I originally posted this Q to StackOverflow and was recommended to ask here)
I have an ASP.NET MVC application and with the help of the Office SDK for VS 2013 and the Azure Portal I've given the website permission to some office 365 api's like Contacts and Sites (RootSite). I can successfully authenticate for both Contacts and RootSite capabilities, but I cannot find any information about how to get a list of available SharePoint sites or list files and folders of a specific SharePoint directory. Is it not possible with the SharePointClient of the Microsoft.Office365.SharePoint.CoreServices library?
I've tried to get files from the "root" (wherever that is in this SharePoint case) with
//...create Discovery client etc...
var dcr = await discClient.DiscoverCapabilityAsync("RootSite");
var client = new SharePointClient(dcr.ServiceEndpointUri, //... and so on...
var files = await client.Files.ExecuteAsync(); // bombs with file not found
But this ends in an FileNotFound Exception.