SharePoint Rest API how to get Access Token?

To call SharePoint specific APIs you need to get a SPO specific access token. You can “swap” an regular MS Graph refresh token for an SPO specific token by doing the following: Get a delegated auth token from graph as you normally would (https://learn.microsoft.com/en-us/graph/auth-v2-user) Use the refresh_token you got and exchange it for an SPO … Read more

How to read SharePoint Online (Office365) Excel files in Python with Work or School Account?

As suggested by Niels V try using the Office365-REST-Python-Client. The client implements the Sharepoint REST API. Here’s an example of what you are trying to do: from office365.runtime.auth.authentication_context import AuthenticationContext from office365.sharepoint.client_context import ClientContext from office365.sharepoint.files.file import File url=”https://yoursharepointsite.com/sites/documentsite” username=”yourusername” password = ‘yourpassword’ relative_url=”/sites/documentsite/Documents/filename.xlsx” This section is straight from the github README.md using the ClientContext … Read more