MS OneDrive Business icon

MS OneDrive Business

Access MS OneDrive for Business and SharePoint

File → Share

AI-generated

Summary

Creates a sharing link for a specified file on OneDrive/SharePoint.

Inputs

  • driveType — Type of drive to access: User Drive, SharePoint Site Drive, or Shared Folder (Link).
  • sharedLinkUrl (required) — Paste the sharing link of the folder or file (must be provided when fileSelection is 'link').
  • userId — User email or ID; leave empty to use the authenticated user.
  • siteId (required) — The SharePoint site to access; required for site drives.
  • fileSelection — How to specify the file: browse, By Path, By ID, or By Sharing Link.
  • fileSharingUrl (required) — Paste the sharing link copied from OneDrive or SharePoint (required when using link selection).
  • linkType — Type of sharing link to create: View (read‑only) or Edit (read‑write).
  • linkScope — Scope of the sharing link: Anonymous (anyone) or Organization (users in the same org).

Output shape

A JSON object representing the created sharing link (contains fields such as type, scope, webUrl, etc.).

The response includes the link details; no pagination. Errors are returned as exceptions.

Examples

Example 1: Create a view‑only link for a file selected via sharing URL and share it with the organization.

Set driveType to 'user', fileSelection to 'link', provide sharedLinkUrl and fileSharingUrl, set linkType to 'view' and linkScope to 'organization'.

Links

Discussion