Microsoft Sharepoint icon

Microsoft Sharepoint

Consume Microsoft SharePoint API

Overview

The Microsoft SharePoint node for n8n allows you to interact with files stored in Microsoft SharePoint sites. Specifically, the File → Get operation retrieves metadata and details about a specific file within a given SharePoint site by its File ID. This is useful for automating document management workflows, auditing file properties, or integrating SharePoint data into other business processes.

Common scenarios:

  • Fetching file information (such as name, size, type, last modified date) for reporting or logging.
  • Validating the existence of a file before performing further actions (e.g., download, share).
  • Integrating SharePoint file metadata into other systems or workflows.

Example:
You might use this node to retrieve details about a contract stored in SharePoint and then send those details via email or log them in another system.


Properties

Name Meaning
Site ID Site ID or site name. Select from available options (e.g., "Financial") or enter custom.
File ID The unique identifier of the file whose details you want to retrieve.

Output

The output is a JSON object containing the metadata and properties of the requested file. Typical fields may include:

{
  "id": "string",
  "name": "string",
  "size": number,
  "file": {
    "mimeType": "string",
    // ...other file-specific properties
  },
  "createdDateTime": "string",
  "lastModifiedDateTime": "string",
  // ...additional SharePoint/Graph API file properties
}
  • Note: The actual structure depends on the SharePoint API response for the file item.

Dependencies

  • External Service: Requires access to Microsoft SharePoint Online.
  • Authentication: Needs OAuth2 credentials (microsoftSharepointOAuth2Api) configured in n8n.
  • Environment: No special environment variables required beyond standard n8n credential setup.

Troubleshooting

Common issues:

  • Invalid Site ID or File ID: If the provided IDs are incorrect or do not exist, the node will throw an error indicating that the resource was not found.
  • Permissions: The connected account must have permission to access the specified site and file.
  • API Errors: Any errors returned by the Microsoft Graph API (such as authentication failures or rate limits) will be surfaced as node errors.

Error messages:

  • "The ID you provided does not belong to a file." – This occurs if the File ID refers to a folder or non-file item.
  • "Request failed with status code 404" – Indicates the file or site could not be found; check your IDs.
  • "Request failed with status code 403" – Indicates insufficient permissions; ensure your OAuth2 connection has the right scopes.

Links and References


Discussion