400 Bad Request When Offset is 10000
Hi there,
Our application is calling the Search for content endpoint to retrieve thousands of files matching specific criteria.
Because we have to retrieve so many files, we "paginate" that endpoint using the limit and offset parameters.
The first call we make looks like the URL below
https://api.box.com/2.0/search?query="3"&content_types=name&type=file&file_extensions=zip&limit=200&offset=0
The next call is the exact same URL, but offset is 200. Then the following call offset is 400.
This should continue until we retrieve all the possible files. However, in our application, the call below consistently fails with a 400 Bad Request error.
https://api.box.com/2.0/search?query="3"&content_types=name&type=file&file_extensions=zip&limit=200&offset=10000
Note all the previous "pagination" calls (offset = 0 upto offset = 9800) are successful. Also, the total_count field has a value of 14151, so offset = 10000 should return files.
Are there some undocumented changes with the Search for content endpoint that caps the number of results that can be returned or does the offset now have a maximum value that it can't exceed?
Thanks
-
I ran into this same issue and asked Box Support about it. They said this was a recent change to the API to limit the pagination to 9999, and there's a request in to update the documentation to reflect that. It sounds like they're saying that search is not really intended for use cases that return more than 10k results. I plan to limit my search and break it into smaller chunks; that should work for my uses.
Please sign in to leave a comment.
Comments
3 comments