title: Office 365 API for SharePoint
body: <p>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.</p>
  
  <p>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.</p>
  
  <pre><code>public static async Task&lt;IEnumerable&lt;IFileSystemItem&gt;&gt; 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 =&gt; e.Id);
              return files;
          }
  </code></pre>
  
  <p>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.</p>