I am trying to get all the files from a SharePoint folder. There are a lot of files in the folder, so I need some way to get them all.
This is the code I used for the request:
$graph = new Graph();
$graph->setBaseUrl("https://graph.microsoft.com/")
->setApiVersion("beta")
->setAccessToken(session('accessToken'));
$children = $graph->createRequest('GET', '/drives/b!2{driveid}/root/children?$top=100')
->setReturnType(Model\DriveItem::class)
->execute();
The response does not include a nextlink
but there are a lot more files in that folder. When I change it to $top=500
, I am only getting the first 500 items.