메인 콘텐츠로 건너뛰기

Microsoft OneDrive Toolkit

The Microsoft OneDrive toolkit connects a OneDrive account to EKB Platform using OAuth and lets agents and workflows list drives and folder contents, search and read files, upload and manage files and folders, and create sharing links. The toolkit uses Microsoft Graph and runs with the connected user's OneDrive permissions.

Prerequisites​

  • A Microsoft work or school account with access to the OneDrive files you intend to use.
  • An EKB Platform project where you can configure an agent or workflow.
  • Your EKB Platform administrator must have configured a Microsoft OAuth integration with the required Graph permissions (Files.ReadWrite.All and Sites.ReadWrite.All for site drives) before you can connect.
  • For shared-with-me items, Files.ReadWrite.All must be consented by your administrator.
경고

Enable only the operations required for the task. Leave write, delete, move, and sharing tools disabled until explicitly needed. Test write operations on a disposable folder first. Never pass a display name as an item ID — always use the item_id and drive_id values returned by list or search tools.

Setup​

  1. Open an agent or workflow in EKB Platform

    Create or open an EKB Platform agent and add the Microsoft OneDrive toolkit, or add a Microsoft OneDrive node to a workflow.

  2. Enable only the tools you need

    Start with read-only tools: List Drives, List Folder Contents, Search Files, Get File Metadata, and Read File Content. Leave write and sharing tools disabled until needed.

  3. Sign in with Microsoft

    Send a request or select the Microsoft sign-in action when EKB Platform prompts for it. Sign in with the Microsoft work or school account that owns the files and grant the requested permissions.

  4. Test with read actions first

    Run List Drives and List Folder Contents to confirm access. Use a disposable test folder for any write operations and verify the results in OneDrive on the web after each write test.

Available tools​

ToolDescription
List DrivesLists the personal drive and accessible group or site drives. Run this first to get drive IDs.
List Folder ContentsLists files and folders in a folder. Prefer item ID over path.
Get Folder TreeReturns a depth- and breadth-capped folder tree (max depth 5).
Get File MetadataReturns ID, name, size, modified time, web URL, and folder or file flags for an item.
Get Special FolderResolves a well-known folder such as Documents or Photos.

Discover​

ToolDescription
Search FilesSearches OneDrive by file name or keyword. Optional drive ID and result limit.
List Recent FilesReturns recently accessed items, ordered by activity.
List Shared With MeLists files shared with the signed-in user. Requires Files.ReadWrite.All.
Resolve Sharing URLConverts a OneDrive, SharePoint, or 1drv.ms sharing link into drive and item IDs.

Read​

ToolDescription
Read File ContentExtracts text from a file. Text files capped at 10 MB; binary at 50 MB; extracted text truncated at 100,000 characters.
Export ItemExports an Office document to PDF and extracts its text.
Get Preview LinkReturns a short-lived preview URL for a file.
Get Item VersionsLists previous versions of a file.
List PermissionsLists sharing permissions on a file or folder.

Write​

ToolDescription
Upload FileUploads a new file. Files larger than 4 MB use a chunked upload session. Conflict behavior defaults to rename.
Create FolderCreates a folder under a parent item or path.
Update FileOverwrites an existing file. Re-read metadata first if the file may have changed.
Rename ItemRenames a file or folder by item ID.
Move ItemMoves a file or folder to a new location by item ID.
Copy ItemCopies a file or folder. Copy is asynchronous and may still be in progress when the tool returns.
Delete ItemMoves the item to the recycle bin. Recycle-bin deletes do not free drive quota.

Share​

ToolDescription
Create Sharing LinkCreates a view or edit sharing link with organization or anonymous scope, as allowed by tenant policy.
Invite Users To ItemInvites people by email with read or write roles.

Use cases​

  • Search OneDrive for a quarterly report, read its content, and summarize it in a workflow.
  • Upload a generated file to a team drive folder and create a sharing link for stakeholders.
  • List folder contents and find recently modified files before triggering a downstream notification.
  • Export a Word document to PDF and pass the extracted text to an agent for analysis.
  • Resolve a sharing URL from a Slack message into a file ID and read its content directly.

Troubleshooting​

SymptomLikely causeFix
Redirect URI mismatchThe OAuth redirect URI in Microsoft Entra does not exactly match the one in EKB Platform Super Admin.Ask your administrator to ensure both URIs match exactly, including protocol and path.
AADSTS53003 Conditional Access errorThe Microsoft Entra tenant blocks app-only token issuance.This is expected for user OneDrive data — users must sign in with the delegated OAuth flow. The Super Admin connection test can still succeed.
403 insufficient permissionsThe required Graph permissions have not been consented by an administrator.Ask your administrator to grant Files.ReadWrite.All and Sites.ReadWrite.All for site drives.
404 item not foundThe item ID is incorrect, the wrong drive ID is specified, or OneDrive is not provisioned for the account.Use List Drives and List Folder Contents to find the correct item_id and drive_id.
412 lost update on file writeThe file changed between when it was read and when the write was attempted.Re-read the file metadata and retry the write operation.
507 insufficient storageThe drive is full. Recycle-bin deletes do not free quota.Empty the recycle bin in OneDrive on the web to free space.
File is locked or checked outAnother user has the file open for editing.Wait for the owner to close or check in the file, then retry.
Workflow cannot use a file from a previous stepA display name was passed instead of an item ID.Use the Variables picker to pass the prior node's id and drive_id values — not the file's display name.