Here's how the Drives API works - every user has access to multiple drives. The OneDrive for Business is just one of the drives. Every SharePoint document library is also a drive.
In general, drives are accessed as /drives/<drive-id>
as the second example on the reference page shows - https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/drive_get.
The OneDrive for Business can be accessed as /me/drive
as a convenience shortcut.
Simply /drive
points to the Shared Documents
document library from the root site collection. Since the reference page doesn't say which drive should be returned, I'd stay away from this API until it gets documented. If the item you are trying to access is not there, it will be natural to get an error.
To unblock yourself:
- Make sure the file you are trying to delete is in the
Shared Documents
folder of the root SharePoint site collection.
- Make sure the user on whose behalf your app is acting has permissions to delete files in the desired folder.
- Make sure you are accessing the correct drive. When you get a drive item, there is a
parentReference
property that contains a driveId
subproperty. Then, to access that item, you can do /drives/<drive-id>/items/<item-id>
.