Microsoft SharePoint
Microsoft SharePoint is a website-based collaboration system that uses workflow applications, โlistโ databases, and other web parts and security features to empower business teams to work together developed by Microsoft.
This notebook covers how to load documents from the SharePoint Document Library. Currently, only docx, doc, and pdf files are supported.
Prerequisitesโ
- Register an application with the Microsoft identity platform instructions.
- When registration finishes, the Azure portal displays the app registration's Overview pane. You see the Application (client) ID. Also called the
client ID
, this value uniquely identifies your application in the Microsoft identity platform. - During the steps you will be following at item 1, you can set the redirect URI as
https://login.microsoftonline.com/common/oauth2/nativeclient
- During the steps you will be following at item 1, generate a new password (
client_secret
) underย Application Secretsย section. - Follow the instructions at this document to add the following
SCOPES
(offline_access
andSites.Read.All
) to your application. - To retrieve files from your Document Library, you will need its ID. To obtain it, you will need values of
Tenant Name
,Collection ID
, andSubsite ID
. - To find your
Tenant Name
follow the instructions at this document. Once you got this, just remove.onmicrosoft.com
from the value and hold the rest as yourTenant Name
. - To obtain your
Collection ID
andSubsite ID
, you will need your SharePointsite-name
. YourSharePoint
site URL has the following formathttps://<tenant-name>.sharepoint.com/sites/<site-name>
. The last part of this URL is thesite-name
. - To Get the Site
Collection ID
, hit this URL in the browser:https://<tenant>.sharepoint.com/sites/<site-name>/_api/site/id
and copy the value of theEdm.Guid
property. - To get the
Subsite ID
(or web ID) use:https://<tenant>.sharepoint.com/sites/<site-name>/_api/web/id
and copy the value of theEdm.Guid
property. - The
SharePoint site ID
has the following format:<tenant-name>.sharepoint.com,<Collection ID>,<subsite ID>
. You can hold that value to use in the next step. - Visit the Graph Explorer Playground to obtain your
Document Library ID
. The first step is to ensure you are logged in with the account associated with your SharePoint site. Then you need to make a request tohttps://graph.microsoft.com/v1.0/sites/<SharePoint site ID>/drive
and the response will return a payload with a fieldid
that holds the ID of yourDocument Library ID
.