2

Using MS Graph API, is there a way that we can find out the driveId of a certain folder with a given SharePoint URL?

The URL would look like this:

https://zpssgpatientsolutions.sharepoint.com/:f:/s/my_site/my_subsite/EllFGxYcxMNKt0kqOYH7OrIBo0AJu5NQ9-jc4rm2RTIKhA?e=IK11dT
knl
  • 969
  • 11
  • 35

1 Answers1

2

There are not currently any APIs to convert from SharePoint URL to OneDrive driveId. On the other hand the OneDrive DriveItem APIs do return the webUrl of the SharePoint file in question.

  • thanks Brian for the answer, I figured that too. I'm looking at [this docs](https://learn.microsoft.com/en-us/graph/api/resources/onedrive?view=graph-rest-1.0) from Microsoft and see that I can get an item in a drive with the `driveId` and the `path` to that item by this endpoint `/me/drive/root:/path/to/file`. Do you know how the `path/to/file/` should look like? – knl Aug 23 '20 at 15:47
  • I attempted variations of the relative path to a file or folder but none have returned a successful result yet. Let me ping an internal team for follow up. – Brian T. Jackett MSFT Aug 24 '20 at 18:15
  • Thanks Brian! Maybe we can improve the docs as well by incorporating more examples. – knl Aug 25 '20 at 01:16
  • :) Docs are open source so if you have suggestions or samples to add can submit a PR / issue. Agreed that this specific scenario could use additional examples. – Brian T. Jackett MSFT Aug 25 '20 at 16:54