I am very much new to Office 365 API's. I am using Microsoft.Office365.SharePoint and Microsoft.Office365.OAuth libraries to access the documents in Office 365 sharepoint site.
I am able to aunthenticate (using SiteApiSample.cs this is the sample provided by MSDN for Office 365 API's) to office 365. I am able to get the file name from sharepoint by using the below code.
public static async Task<IEnumerable<IFileSystemItem>> GetDefaultDocumentFiles()
{
var client = await EnsureClientCreated();
client.Context.IgnoreMissingProperties = true;
// Obtain files in default SharePoint folder
var filesResults = await client.Files.ExecuteAsync();
var files = filesResults.CurrentPage.OrderBy(e => e.Id);
return files;
}
Now my intention is that, I would need to get the file content / folder content to a byte array. I have tried several ways, but did not worked. If some one has working sample with this request you to please share. Thank you.