phpSPO
phpSPO copied to clipboard
[OneDrive] Wrong resource path
Hi,
I try to download files from folder but it doesn't work - response: "Invalid request". When I've checked request url it is wrong:
https://graph.microsoft.com/v1.0/me/Drive/items/items/<FILE_ID>/content
Should be:
https://graph.microsoft.com/v1.0/me/Drive/items/<FILE_ID>/content
Duplicated items comes from Office365\Runtime\ResourcePath::toUrl method.
Quickfix - remove additional segments before get file url path.
Sth like this:
$segments = array_unique($segments);
Download files from root folder works fine (request path set correctly).