Smartgent SharePoint icon

Smartgent SharePoint

Get documents from SharePoint document libraries using Microsoft Graph API

Get Document Details

AI-generated

Overview

This node operation retrieves detailed information about a specific document from a SharePoint document library using the Microsoft Graph API. It is useful for scenarios where you need to fetch metadata and properties of a document by its ID, such as document name, size, modification date, and download URL. For example, it can be used to display document details in a workflow or to verify document attributes before further processing.

Use Case Examples

  1. Fetching document metadata to display in a dashboard.
  2. Retrieving document properties before downloading or moving the file.
  3. Validating document details in an automated approval process.

Properties

Name Meaning
Document ID The unique identifier of the document to retrieve details for.

Output

JSON

  • operation - The operation performed, which is 'getDocument'.
  • siteId - The SharePoint site ID where the document resides.
  • driveId - The drive ID (document library) containing the document.
  • documentId - The ID of the retrieved document.
  • document
    • id - The document's unique identifier.
    • name - The name of the document.
    • lastModifiedDateTime - The last modification date and time of the document.
    • size - The size of the document in bytes.
    • webUrl - The web URL to access the document in SharePoint.
    • downloadUrl - The direct download URL for the document.
    • mimeType - The MIME type of the document file.
    • createdDateTime - The creation date and time of the document.
    • lastModifiedBy - Information about the user who last modified the document.
    • createdBy - Information about the user who created the document.
  • timestamp - The timestamp when the operation was performed.

Dependencies

  • Requires Microsoft Graph API access via an API key credential for SharePoint.
  • Needs valid SharePoint site URL and OAuth credentials for authentication.

Troubleshooting

  • Error 'Invalid client credentials' indicates incorrect or expired API credentials; verify tenant ID, client ID, and client secret.
  • Error 'Could not find folder' or 'No drives found' suggests incorrect site URL or document library path; verify the SharePoint site and library paths.
  • Access denied errors indicate insufficient permissions; ensure the API credentials have appropriate SharePoint access rights.
  • Network or HTTP errors may require checking connectivity and Microsoft Graph API service status.

Links

Discussion