How to upload a file via Graph API To a SharePoint
Graph API is a powerful tool that allows developers to interact with various Microsoft services, including SharePoint. With Graph API, it's easy to upload files to a SharePoint site. Today, I would like to share my knowledge on how to upload a file to a SharePoint site using Graph API via Postman. Postman is a popular tool for testing and managing APIs, developers can easily test the Graph API's file upload functionality and ensure that the system is working as expected.
The process of uploading a file to SharePoint via Graph API involves sending a request to the SharePoint Graph API endpoint. Before sending a request to the SharePoint Graph API endpoint, the developer must authenticate and authorize the request using Microsoft's authentication mechanism based on OAuth 2.0 protocol. This involves obtaining an access token that allows the developer to access the required SharePoint site.
Overall, the combination of Graph API, SharePoint, and Postman can be a powerful tool for businesses looking to streamline their document management processes and improve collaboration among team members.
1. Registering your App in Azure Portal
Select API permissions from left hand side navigation menu and then select graph API.
2. Uploading a file Via Postman.
Recommended by LinkedIn
https://graph.microsoft.com/v1.0/sites/{{SiteID}} /Drives.
https://graph.microsoft.com/v1.0/drives/{{DriveID}}/root:/ERP-CRM Enhancement (ERP Dev)/BC.png:/content.
Hope you find it useful.
Thank you.
Thanks! .. This came in handy for publishing a daily Excel-based report in a public folder on a Sharepoint site. Until today, we were publishing that content to S3, where only a handful of people were able to see it. Now anyone can eaily get their hands on a copy. FWIW, I did find it handy to use MSGraph Explorer to work out the details of our particular solution: https://developer.microsoft.com/en-us/graph/graph-explorer In most cases, it saves the tedium of app registration .. once you have the solution worked out, you can slog through the OAuth stuff. But, yeah .. very nice .. it was easy to get it working. Thanks again!
Great Article, save my day
I've been stuck on uploading a file to sharepoint for the last 2 weeks. This article is so helpful! Thank You.
It would be great if the screenshots were legible...
Thank you very much! I have been struggling for 2.5 weeks trying to upload files to sharepoint with php through their API. This was the missing element that allowed me to come to a solution. Thank you again!