Skip to main content
The configuration is subject to change depending on permissions, restricted access on the SharePoint level, etc.

Register an application

1

Register the application

Follow the steps to register an application that the Cognite File extractor will use to connect to SharePoint Online.
2

Set up groups (optional)

3

Assign API permissions

Assign relevant API permissions to use Microsoft Graph API. The example has the minimal setup for the File extractor to read all SharePoint Online sites.
App Registration API permissions showing Sites.Read.All and User.Read permissions

SharePoint app permissions

After creating the App Registration, add its details to the SharePoint administration app registration.
1

Create SharePoint app permission

To create a new SharePoint app permission, go to this URL https://YOUR-SHAREPOINT-NAME-admin.sharepoint.com/_layouts/15/AppInv.aspx, where YOUR-SHAREPOINT-NAME should be changed. Make sure to use your Microsoft 365 admin account.
2

Enter Application ID

Enter your Application (client) ID in the App Id field and select Lookup. You should see the App registration details filled out.
SharePoint App permission configuration screen with App Id lookup field
3

Configure App Domain and Redirect URL

Enter App Domain and Redirect URL of your App registration. For a local execution of the File extractor, enter the values of a localhost domain:
4

Add Permission Request XML

Add the App’s Permission Request XML to configure the SharePoint permission level. This may vary from every configuration scenario. The example gives the minimal XML with the Read permissions to all SharePoint sites.
The configuration is subject to change depending on permissions, restrict access on the SharePoint level, etc.
5

Confirm trust

Select Create and then confirm that you trust SharePoint.

Run extractor

Once you register the application and add the SharePoint app permissions, you can extract files from SharePoint Online.
1

Download the extractor

Go to Data fusion > Integrate > Extractors > Cognite File extractor > Download extractor.
2

Configure the extractor

In the downloaded folder, find and edit the example-sharepoint.yaml configuration template by setting the App registration information and the related SharePoint configuration parameters.
3

Run the extractor

Run the extractor. The example has a successful execution log.
4

Verify extraction

Check the extracted files in Data fusion > Data explorer.

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 under sharepoint_online.paths. You can specify the path as a URL or as a structured path. Use a URL when you can copy the location directly from the SharePoint address bar. Use a structured path when the site hierarchy has two or more nested subsites (for example, 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 a url path. For example, https://cogsp.sharepoint.com/sites/MySite.
URLs with /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 shows https://cogsp.sharepoint.com/sites/MySite/Subsite1/Subsite2/Shared%20Documents, configure a structured path instead of a URL path:
Separate each nested subsite in sub_sites with /. There is no depth limit.
This feature requires Cognite File extractor 2.12.0 or later.

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 called Documents, 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.
1

Navigate to the document library

Go to the document library you want to extract.
2

Copy the URL

Copy the beginning of the URL until /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:
1

Select the file or folder

In SharePoint Online, go to Documents and select the file or the folder you want to extract.
2

Open details

Select More actions (…) > Details.
3

Copy the direct link

Scroll down to Paths and select Copy direct link to copy the URL to your clipboard, for example, 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.
The 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.
The extractor returns this error when it cannot resolve the document library for a SharePoint path configured with 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.
Cognite File extractor 2.12.0 and later uses the same error message for these URL path cases as earlier versions. Upgrade alone does not fix the error. You need a structured path for multilevel subsites.
To fix the error:
  1. Use Cognite File extractor 2.12.0 or later (required for structured paths).
  2. Replace the URL path with a structured path that sets host, site, and sub_sites. See Paths to nested subsites.
  3. For parameter details, see sharepoint_structured_path in the configuration reference.
Last modified on August 5, 2026