Hello there,
I encountered an issue using the https://github.com/gwsn/flysystem-sharepoint-adapter package.
In my use case, document libraries exist directly under the root site (e.g., https://tenant.sharepoint.com/LibraryName/ instead of https://tenant.sharepoint.com/sites/SiteName/).
Querying the root level site through the given example returns a "Cannot parse the body of the sharepoint site request" error when querying it.
I fixed this by writing a custom connector that skips this condition entirely (https://github.com/gwsn/sharepoint-sdk/blob/main/src/Sharepoint/SharepointService.php#L45):
Severely redacted snippet of my code:
foreach ($drives as $drive) {
if ($drive['name'] === $driveName) {
$driveId = $drive['id'];
break;
}
}
if (isset($driveId)) {
$driveService = new DriveService($accessToken);
$driveService->setDriveId($driveId);
$this->setDrive($driveService);
$this->setFolder(new FolderService($accessToken, $driveId));
$this->setFile(new FileService($accessToken, $driveId));
}
I'm not sure if this is the best way to address this issue.
I'd like to suggest a more flexible approach where you can directly query the root site instead of requiring the /sites/xxx prefix.
If this is already possible, an example would be greatly appreciated. I could not get it to work personally.
Thanks in advance!
Hello there,
I encountered an issue using the https://github.com/gwsn/flysystem-sharepoint-adapter package.
In my use case, document libraries exist directly under the root site (e.g., https://tenant.sharepoint.com/LibraryName/ instead of https://tenant.sharepoint.com/sites/SiteName/).
Querying the root level site through the given example returns a
"Cannot parse the body of the sharepoint site request"error when querying it.I fixed this by writing a custom connector that skips this condition entirely (https://github.com/gwsn/sharepoint-sdk/blob/main/src/Sharepoint/SharepointService.php#L45):
Severely redacted snippet of my code:
I'm not sure if this is the best way to address this issue.
I'd like to suggest a more flexible approach where you can directly query the root site instead of requiring the /sites/xxx prefix.
If this is already possible, an example would be greatly appreciated. I could not get it to work personally.
Thanks in advance!