Microsoft Graph API to read file stored in Sharepoint Site

Aich, Mainak 1 Reputation point
2022-07-11T15:30:27.927+00:00

Hello,

I am looking for a graph API to read a file which is stored in my MS SharePoint site hosted in Azure Cloud. E.g. my site name is <SiteName> and file name is <File1.xlsx>. Can you please suggest what will be the API to read the file content in response body?

I am testing the APIs in MS Graph Explorer.

Thanks,
Mainak

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,448 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. CarlZhao-MSFT 40,311 Reputation points
    2022-07-12T08:09:25.21+00:00

    Hi @Aich, Mainak

    You can use this graph api endpoint to read file stored in a SharePoint site:

    https://graph.microsoft.com/v1.0/sites/{site id}/drive/root:/File1.xlsx  
    

    219813-image.png


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.