0
votes

I'm trying to download a file located in a M365 site via the Graph API. If I reference the site via "hostname,siteID,webID", the request works via HttpClient, the Graph API SDK and Graph Explorer:

https://graph.microsoft.com:443/v1.0/sites/hostname.sharepoint.com,fe0f6782-2cc6-447a-938f-bf6a379ed791,133e22cf-9a72-4ff2-a700-c0accacdcc8d/lists/Documents/drive/items/017TIGYVRADE3TAWYAQZBI3ET6GTHX77QO/content

If I try to reference the site via the site relative URL method, the request fails if there is information beyond the "drive" part of the URL:

https://graph.microsoft.com:443/v1.0/sites/hostname.sharepoint.com:/sites/MySiteCollection:/lists/Documents/drive/items/017TIGYVRADE3TAWYAQZBI3ET6GTHX77QO/content

ServiceException: Code: BadRequest Message: Url specified is invalid. Inner error: AdditionalData: request-id: d897756c-f135-4ac2-85e3-454e8a8fd627 date: 2020-05-04T14:47:07 ClientRequestId: d897756c-f135-4ac2-85e3-454e8a8fd627

The query works fine until just after expressing the "Documents" list as a Drive.

This works: https://graph.microsoft.com:443/v1.0/sites/hostname.sharepoint.com:/sites/MySiteCollection:/lists/Documents/drive
This doesn't work: https://graph.microsoft.com:443/v1.0/sites/hostname.sharepoint.com:/sites/MySiteCollection:/lists/Documents/drive/

Why doesn't the server relative URL method of accessing a site work?

I have experienced similar small differences between expressing site-id as relativeUrl and hostname,site-guid,web-guid. Will update if find anything confirmed to share.Brian T. Jackett MSFT
Thank you - should I open a bug for this?Eli
You can open a ticket or bug, but at the current time it might not get routed to the correct people. I 'm hearing there may be an update to share after Build next week. I'm sharing this scenario (and similar related ones) with the pertinent PMs this week. Will update after talking with them.Brian T. Jackett MSFT
I am facing the same issue - Were you able to solve this issue?Schutt