Overview
This node integrates with SharePoint document libraries via the Microsoft Graph API to perform operations on documents. Specifically, for the "Get Document Details" operation, it retrieves detailed metadata about a specific document identified by its ID within a SharePoint site.
Common scenarios where this node is beneficial include:
- Automating workflows that require fetching document metadata for processing or auditing.
- Integrating SharePoint document information into other systems or reports.
- Validating document existence and properties before further actions like downloads or updates.
For example, you might use this node to get the size, last modified date, MIME type, and URLs of a document in SharePoint to decide whether to download or share it.
Properties
| Name | Meaning |
|---|---|
| Document ID | The unique identifier of the document to retrieve details for. |
| Additional Options | Optional parameters to refine queries (not used directly in "Get Document Details" operation but available for others): - Filter: OData filter expression. - Select Fields: Comma-separated list of fields to include. - Top: Maximum number of items to return (1-1000). |
Note: For the "Get Document Details" operation, only the Document ID property is required and used.
Output
The output JSON object contains detailed metadata about the requested document, including:
operation: The string"getDocument"indicating the performed operation.siteId: The SharePoint site identifier.driveId: The drive (document library) identifier.documentId: The ID of the retrieved document.document: An object with document details such as:id: Document ID.name: Document name.lastModifiedDateTime: Timestamp of last modification.size: File size in bytes.webUrl: URL to access the document in SharePoint.downloadUrl: Direct download URL.mimeType: MIME type of the document.createdDateTime: Creation timestamp.lastModifiedBy: Information about who last modified the document.createdBy: Information about who created the document.
timestamp: ISO string timestamp when the operation was executed.
Example snippet of the JSON output field:
{
"operation": "getDocument",
"siteId": "site-id-string",
"driveId": "drive-id-string",
"documentId": "document-id-string",
"document": {
"id": "document-id-string",
"name": "example.pdf",
"lastModifiedDateTime": "2024-06-01T12:34:56Z",
"size": 123456,
"webUrl": "https://sharepoint.com/...",
"downloadUrl": "https://...",
"mimeType": "application/pdf",
"createdDateTime": "2024-05-01T08:00:00Z",
"lastModifiedBy": { /* user info */ },
"createdBy": { /* user info */ }
},
"timestamp": "2024-06-10T15:00:00Z"
}
No binary data is output for this operation.
Dependencies
- Requires an API key credential for Microsoft Graph API authentication with appropriate permissions to access SharePoint sites and documents.
- The node uses OAuth2 client credentials flow to obtain an access token.
- Requires configuration of the SharePoint site URL in the credentials.
- Relies on Microsoft Graph API endpoints to fetch site IDs, drive IDs, and document details.
Troubleshooting
- Authentication errors: If the node fails to authenticate, verify the tenant ID, client ID, and client secret are correct and have sufficient permissions.
- Invalid Document ID: Errors may occur if the provided document ID does not exist or is inaccessible; ensure the ID is valid and belongs to the configured SharePoint site.
- Site URL issues: If the site URL in credentials is malformed or incorrect, the node may fail to resolve the site ID.
- API limits: The Microsoft Graph API has rate limits; excessive requests may cause throttling errors.
- Error messages:
"Authentication failed: Invalid client credentials."— Check API credentials."No drives found for the site"— Verify the SharePoint site has accessible document libraries."SharePoint operation failed: <message>"— General failure; check message for specifics.
To resolve most issues, confirm all input parameters, credentials, and SharePoint configurations are accurate.