Microsoft Sharepoint icon

Microsoft Sharepoint

Consume Microsoft SharePoint API

Overview

The Microsoft SharePoint node for n8n allows you to interact with SharePoint folders. Specifically, the Folder → Share operation enables you to generate sharing links for a specified folder within a SharePoint site. This is useful when you want to provide access to a folder either to people inside your organization or to external users, with different permission levels (view, edit, embed).

Common scenarios:

  • Sharing project documentation folders with team members.
  • Granting external partners view-only access to a specific folder.
  • Embedding a folder's contents in another application or website.

Practical example:
You have a folder containing marketing materials on SharePoint and want to generate a link that allows anyone in your organization to view it. You can use this node to automate the creation of such a link and distribute it as needed.

Properties

Name Meaning
Site ID The identifier or name of the SharePoint site where the folder resides.
Folder ID The unique identifier of the folder you wish to share.
Type The type of sharing link to create. Options:
- View (read-only access)
- Edit (edit permissions)
- Embed (for embedding in web pages)
Scope The audience for the sharing link. Options:
- Anonymous (anyone with the link)
- Organization (only people in your organization)

Output

The output will be a JSON object containing the details of the created sharing link. Typical fields include:

{
  "link": {
    "type": "view",
    "scope": "organization",
    "webUrl": "https://...",
    ...
  }
}
  • link.type: The type of link created (e.g., "view", "edit", "embed").
  • link.scope: The scope of the link ("anonymous" or "organization").
  • link.webUrl: The URL that can be shared with others to access the folder.

Additional metadata may be included depending on the SharePoint API response.

Dependencies

  • External Service: Microsoft SharePoint Online.
  • Authentication: Requires an OAuth2 credential of type microsoftSharepointOAuth2Api configured in n8n.
  • n8n Configuration: Ensure the credentials are set up with appropriate permissions to create sharing links for folders.

Troubleshooting

Common issues:

  • Invalid Site ID or Folder ID: If the provided IDs are incorrect, the node will fail with an error from the SharePoint API. Double-check the values.
  • Insufficient Permissions: The connected account must have permission to create sharing links for the target folder.
  • API Errors: If SharePoint returns an error (e.g., due to policy restrictions), the error message will be included in the node's output under an error field.

Error messages and resolutions:

  • "The ID you provided does not belong to a file." – Make sure you are using a folder ID, not a file ID, for this operation.
  • Authentication errors – Re-authenticate or check the OAuth2 credentials in n8n.

Links and References

Discussion