Hello,
I'm trying to access the files of drives by the name of the drive and site.
Setup:
Host - wvgsg.sharepoint.com
Site - TheLanding
Drive - Test
I can use this URL to list all drives a site has access to:
https://graph.microsoft.com/v1.0/sites/wvgsg.sharepoint.com:/sites/TheLanding:/drives
{
"description": "A testing document library",
"id": "b!DVGGM-_KkUq4v2cyNId7Qx1d-mCSpvlIo4R12S5zDlAhreGzy6w4TZoC9t-cexvv",
"name": "Test",
"webUrl": "https://wvgsg.sharepoint.com/sites/TheLanding/Test",
"driveType": "documentLibrary",
},
{
"description": "Files on Sharepoint site",
"id": "b!DVGGM-_KkUq4v2cyNId7Qx1d-mCSpvlIo4R12S5zDlDQ6yOJeVONRbbpySNc0JYm",
"name": "The Landing files",
"webUrl": "https://wvgsg.sharepoint.com/sites/TheLanding/The%20Landing%20files",
"driveType": "documentLibrary",
},
Now I want to access either of those 2 drives by using an URL that looks something like:
https://graph.microsoft.com/v1.0/sites/wvgsg.sharepoint.com:/sites/TheLanding:/drives:/Test
But I'm left with a Bad request - 400
{
"error": {
"code": "BadRequest",
"message": "Resource not found for the segment 'drives:'.",
"innerError": {
"date": "2022-09-20T12:43:24",
"request-id": "013cdfd6-a5ff-4337-a236-0eb39f14b8e3",
"client-request-id": "8f0b5c98-339a-7755-8637-4775b7704f1e"
}
}
}
The reason why I need to use the Names and not IDs is because the user is expected to input their site and drive names.