Smartgent SharePoint icon

Smartgent SharePoint

Get documents from SharePoint document libraries using Microsoft Graph API

List Documents

AI-generated

Overview

The Smartgent SharePoint node's 'List Documents' operation retrieves all documents from a specified SharePoint document library path using the Microsoft Graph API. It is useful for scenarios where users need to fetch and list documents stored in SharePoint libraries, such as for document management, auditing, or integration with other workflows. For example, a user can list all documents in the root or a subfolder of a SharePoint library, optionally filtering or selecting specific fields, and limiting the number of returned items.

Use Case Examples

  1. List all documents in the root Documents library.
  2. List documents in a specific subfolder with a filter to only include PDFs.
  3. Retrieve a limited number of documents with selected fields like id, name, and size.

Properties

Name Meaning
Document Library Path Specifies the path to the SharePoint document library or subfolder to list documents from. Use '/' for the root/main Documents library.
Additional Options Optional parameters to refine the document listing, including OData filter expressions, fields to select in the response, and the maximum number of items to return.

Output

JSON

  • operation - The operation performed, here 'listDocuments'.
  • siteId - The SharePoint site ID from which documents are listed.
  • driveId - The drive ID representing the document library.
  • libraryPath - The path of the document library or folder queried.
  • documents - An array of document objects retrieved, each containing properties like id, name, lastModifiedDateTime, size, webUrl, downloadUrl, and mimeType.
  • totalCount - The total number of documents returned in the list.
  • timestamp - The timestamp when the operation was performed.

Dependencies

  • Microsoft Graph API access via OAuth2 credentials

Troubleshooting

  • Authentication errors due to invalid client credentials or tenant ID. Verify API credentials and tenant configuration.
  • Errors in site URL format or site not found. Ensure the SharePoint site URL is correct and accessible.
  • No drives or document libraries found for the site. Confirm the site has a Documents library.
  • Access denied errors when permissions are insufficient to list documents.
  • Invalid filter or select expressions causing API request failures.

Links

Discussion