Reading an excel file from OneDrive using REST and the Microsoft Graph API

In this article I will demonstrate how to get sample information from an Excel file stored in a OneDrive, using nothing more than the Microsoft Graph API.


Richard diZerega blogged about and has talked further on the new beta graph API capability for Using OneDrive and Excel APIs in the Microsoft Graph for App Storage. Using that as a reference and the Excel REST API for the graph documentation I was able to piece together this example.

Getting data from an excel file

Load a sample excel file into your OneDrive root, in this case marky.xlsx with a simple example


Access the file using the Graph API

Using the Graph Explorer we are able to test out our files. Note that this is currently (1 Aug 2016) in BETA and the left hand drop down for version must be beta. The URLs referenced in this article all contain /beta/. Once the capability goes GA then it will become part of the next version 1.0+.




and there we have our data from the excel file – pretty simple eh !


Using the Microsoft Graph API we can easily reach into an excel file, stored in OneDrive and extract the data for use in other places.



And then not two days later this went GA – so v1.0 also now works 🙂



4 thoughts on “Reading an excel file from OneDrive using REST and the Microsoft Graph API

    • Hey Patrick – thanks for the feedback 🙂

      I am afraid it is OneDrive only right now.

      That said OneDrive is basically SharePoint under the covers anyway so who knows, maybe in the future 🙂 I have no idea though and have heard nothing to suggest that it will be.

  1. this is one good. But how do I get authorization bearer token? is there any url where i can pass my username and password to get authorization bearer token

  2. There are two ways to do oauth

    From the client you pass the user through the OAuth flow, have them log in and create a temporary OAuth token. You use this to pass to the service on behalf of the user.

    The alternate is using client_secret on the back end and having a token created in that manner.

    In neither case do you pass username and password.

    I suggest you google MS Graph OAuth mechanism – the documentation link will show you the info you need 🙂

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s