Register an application
Register the application
Set up groups (optional)
Assign API permissions

SharePoint app permissions
After creating the App Registration, add its details to the SharePoint administration app registration.Create SharePoint app permission
YOUR-SHAREPOINT-NAME should be changed. Make sure to use your Microsoft 365 admin account.Enter Application ID

Configure App Domain and Redirect URL
Add Permission Request XML
Read permissions to all SharePoint sites.Confirm trust
Run extractor
Once you register the application and add the SharePoint app permissions, you can extract files from SharePoint Online.Download the extractor
Configure the extractor
example-sharepoint.yaml configuration template by setting the App registration information and the related SharePoint configuration parameters.Run the extractor
Verify extraction
Find the right paths in SharePoint Online
You can configure the File extractor to extract data from various paths in SharePoint Online. It’s possible to provide paths to sites, document libraries, folders, and individual files.Choose a URL or structured path
In your extractor configuration, each SharePoint source is a path undersharepoint_online.paths. You can specify the path as a URL or as a structured path.
site/subsite1/subsite2/library).
For structured path parameters, see sharepoint_structured_path in the configuration reference.
Paths to sites
You can get paths to sites from the address bar in your browser. Go to your SharePoint Online site, copy the URL from the address bar, and paste it into your configuration as aurl path.
For example, https://cogsp.sharepoint.com/sites/MySite.
/teams/ instead of /sites/ are valid for URL paths. Structured paths support /sites/ only.Paths to nested subsites
If your files live under two or more nested subsites, use a structured path in your configuration. URL paths do not support this hierarchy. For example, if the address bar showshttps://cogsp.sharepoint.com/sites/MySite/Subsite1/Subsite2/Shared%20Documents, configure a structured path instead of a URL path:
sub_sites with /. There is no depth limit.
Paths to document libraries
Sites in SharePoint Online can contain one or more document libraries where you store your files. New sites generally have only a document library calledDocuments, but you can create any number of document libraries.
To extract a single document library from a site, you need to find this document library URL.
For a document library under a single subsite, you can use a URL path. Copy the URL from the address bar until /Forms/AllItems.aspx, for example, https://cogsp.sharepoint.com/sites/MySite/Subsite1/Shared%20Documents.
For a library under two or more nested subsites, use a structured path. See Paths to nested subsites.
Navigate to the document library
Copy the URL
/Forms/AllItems.aspx, for example, https://cogsp.sharepoint.com/sites/MySite/Shared%20Documents.Paths to files and folders
To find paths to files and folders:Select the file or folder
Open details
Copy the direct link
https://cogsp.sharepoint.com/sites/MySite/Shared%20Documents/my%20folder/test.doc.The copied URL matches the document library URL with the file or folder path added.recursive setting traverses folders inside the resolved document library. It does not traverse into additional SharePoint subsites.Troubleshooting
If extraction fails when you configure SharePoint paths, try the solutions below.ValueError: Couldn't obtain document library id
ValueError: Couldn't obtain document library id
url:.You may see it when:- The document library is missing from the URL or points to the wrong library.
- The URL path includes two or more nested subsites before the document library.
- Use Cognite File extractor 2.12.0 or later (required for structured paths).
- Replace the URL path with a structured path that sets
host,site, andsub_sites. See Paths to nested subsites. - For parameter details, see
sharepoint_structured_pathin the configuration reference.