I'm not familiar at all with SharePoint, I am trying to build a php script to browse and access files shared with us on a folder like this : https://blabla.sharepoint.com/:b:/r/sites/SubSiteName/Shared%20Documents/OurCompanyName/Invoice
I've found those libraries : https://github.com/vgrem/phpSPO and https://github.com/thybag/PHP-SharePoint-Lists-API, but I can't find the good way to access the files. I've also found posts speaking of php & SharePoint here, but none seems to match my need.
I've tried this code with phpSPO, but it fails at executeQuery() :
$authCtx = new AuthenticationContext('https://blabla.sharepoint.com');
$authCtx->acquireTokenForUser('our@email','password');
$ctx = new ClientContext('https://blabla.sharepoint.com',$authCtx);
$fileUrl = '/sites/SubSiteName/Shared Documents/OurCompanyName/Invoice/INV_123.PDF';
$file = $ctx->getWeb()->getFileByServerRelativeUrl($fileUrl);
$ctx->load($file);
$ctx->executeQuery();
print "File name: '{$file->getProperty("Name")}'\r\n";