How to combine onedrive API "share" with onedrive path-based addressing?

Lucian Wischik 10 Reputation points
2025-05-15T16:15:54.3633333+00:00

The documentation at https://learn.microsoft.com/en-us/onedrive/developer/rest-api/api/shares_get explains how to download information about a shared OneDrive Personal folder, e.g.

https://api.onedrive.com/v1.0/shares/${shareId}/driveItem?$expand=children

The documentation at https://learn.microsoft.com/en-us/onedrive/developer/rest-api/concepts/addressing-driveitems says you can do path-based addressing, e.g.

https://api.onedrive.com/v1.0/drives/${driveId}/items/${rootId}:/${path}:/content

But how do I do path-based addressing relative to /shares? I tried shares/${shareId}:/${path}:/content but it responded with {"error":{"code":"invalidRequest","message":"Bad Argument"}}.

Is there some other way to do path-based addressing relative to a share?

Microsoft 365 and Office | OneDrive | For business | Windows
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.