Issue with accessing SharePoint Subfolder

Issues Accessing SharePoint Subfolders

I’m trying to access a specific folder in SharePoint using n8n, but I’m encountering various error messages. I hope someone has experience with this issue and can help me.

What I’m Trying to Achieve

I want to access the following SharePoint folder:

https://mycompany.sharepoint.com/sites/FE/FEDE/02_Intern/10_Test AI_Automation

Error Messages and Previous Attempts

Attempt 1: Standard SharePoint API Path

First, I tried to access using the standard path:

https://mycompany.sharepoint.com/_api/Web/GetFolderByServerRelativePath(decodedurl='/sites/FE/FEDE/02_Intern/10_Test AI_Automation')

Error Message: 404 - “The resource you are requesting could not be found”

{"error":{"code":"-2147024894, System.IO.FileNotFoundException","message":{"lang":"de-DE","value":"Datei nicht gefunden."}}}

Attempt 2: Direct API Access to the Subsite

Then I tried to access the subsite directly:

https://mycompany.sharepoint.com/sites/FE/FEDE/_api/web/lists

Error Message: 403 - “Forbidden - perhaps check your credentials?”

{"error":{"code":"-2147024891, System.UnauthorizedAccessException","message":{"lang":"","value":"Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))"}}}

Attempt 3: Various API Variants

I tried different API path variants:

  • /GetFolderByServerRelativeUrl instead of /GetFolderByServerRelativePath
  • Different URL encodings for spaces and special characters
  • Requests to base folders to understand the structure

All of these attempts resulted in either 404 or 403 errors.

Configuration and Permissions

In Microsoft Azure, I have configured the following Graph API permissions:

  • Files.Read.All
  • Files.ReadWrite.All
  • Files.ReadWrite.AppFolder
  • Sites.FullControl.All
  • Sites.Manage.All
  • Sites.Read.All
  • Sites.ReadWrite.All
  • Sites.Selected
  • User.Read
  • User.ReadBasic.All

These permissions show as “Granted for MyCompany” in Azure.

Questions

  1. How can I correctly access the subfolder in a SharePoint subsite via n8n?
  2. Is my API path format correct, or is there a different syntax for subsites?
  3. Could there be an issue with the authentication method, even though I have all the necessary permissions?
  4. Should I use the Microsoft Graph connector instead of the SharePoint HTTP Request? If so, what would be the correct access path?

I appreciate any help or suggestions. Thank you in advance!

Bump - Would really appreciate some help! Thank you!

Any news on this topic? I am currently struggeling with the same problem.

1 Like