2

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.

Marc LaFleur
  • 31,987
  • 4
  • 37
  • 63
  • I'm using v1.0, not beta but I have seen some really [weird quirks](https://stackoverflow.com/questions/56364959/why-are-skip-parameters-going-ridiculously-high) with nextLink none the less while using the graph api (I can't say for sure as my issues haven't been resolved, but I am leaning towards believing it is an issue with their api) – AAvery May 31 '19 at 14:04
  • Could you please include an example of the result (just the first 5-10 lines of the JSON is fine)? Also, have you tried not setting `$top` at all? – Marc LaFleur Jun 03 '19 at 17:18

0 Answers0