Skip to main content

Box API is not returning the files consistently

  • September 27, 2023
  • 2 replies
  • 201 views

Hi, We have observed that the Box API is not returning the files consistently in multiple runs, however, this issue is occurring rarely.

Sometimes it fetches less files than what is present in the Box without making any changes anywhere.


We are using the following Box SDK.


<dependency>

  <groupId>com.box</groupId>

  <artifactId>box-java-sdk</artifactId>

  <version>2.58.0</version>

</dependency>


Sample code:


BoxFolder folders = new BoxFolder(api, userRootFolderId);

    folders.forEach(item-> {      

      if (itemInfo instanceof BoxFile.Info) {

        BoxFile.Info fileInfo = (BoxFile.Info) itemInfo;

        log.info("Fetched BoxFile {} with id {}.", fileInfo.getName(), fileInfo.getID());       

      } else if (itemInfo instanceof BoxWebLink.Info) {        

      if (boxConfiguration.getCrawlWebLinks()) {           

        log.info("Fetched Weblink {} with id {}.", item.getName(), item.getID());         

      } else if (itemInfo instanceof BoxFolder.Info) {         

        log.info("Fetched folder {} with id {}.", itemInfo.getName(), itemInfo.getID());       

      }

    });


Can you please help here?

2 replies

  • Participating Frequently
  • 5 replies
  • September 29, 2023

Certainly looks pretty strange. Did you try to call missing files by id? You should try to upgrade Java SDK as our current version is 4.6.0 or/and try to reproduce the issue using e.g. cURL (it’s hard to imagine that’s an SDK issue).


  • Author
  • New Participant
  • 1 reply
  • October 4, 2023

Hi @mwoda,

Your question: Did you try to call missing files by id?

My response: The use case is first we need to fetch a list of all files and then fetch each file by file id.

The issue we are getting while listing out the files. Sometimes we are not getting all the files while listing out.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings