3

When I am trying to search some term from JAVA sdk of BOX API , I am getting only 400 Results while when i search the same term on app.box.com i am getting 1270 results. Please help regarding this .

BoxAPIConnection api = new BoxAPIConnection("developer token");
    BoxFolder rootFolder = BoxFolder.getRootFolder(api);
    Iterable<BoxItem.Info> results = rootFolder.search("*.pdf");


    for (BoxItem.Info result : results) {

     System.out.println("Result:"+i+" FileName&ID:"+result.getName()+" "+result.getID());
//Only Returning 400 Results
    }
RendezAWS
  • 103
  • 9

1 Answers1

1

There is no limit in the Java SDK for Box API with regards to how many items will be returned. The Iterable<BoxItem.Info> returned by BoxFolder.search() will iterate until the Box API returns no more results (in batches of 200 items).

Therefore, except if you are hitting some sort of an error in the communication with the Box API (use Charles Proxy or Fiddler or similar tool to monitor that), it means that you are hitting a scope issue. A possible explanation would be that when you search at box.com you search in enterprise scope, while when you search via the API you search in user scope. Can you check the results for that?

PlusInfinite
  • 206
  • 2
  • 12