Api GET Folder Items With Offset and Limit Not Working
According to the docs, I should do this:
curl https://api.box.com/2.0/folders/FOLDER_ID/items?limit=2&offset=0 \ -H "Authorization: Bearer ACCESS_TOKEN"
Which seems very simple. And I believe I am following these instructions to the letter. When I make the api call, my url looks like this:
https://api.box.com/2.0/folders/34******/items?limit=10&offset=50
And that seems absolutely correct. But the response I get back gives me the first 100 records, instead of records 50-60. In fact, the meta data I get back from this api call shows "offset":0, "limit":100, as if I didn't provide any limit or offset params at all. Here is a small snippet of that:
{"total_count":101,"entries":[ {"type":"folder","id":"493... ...917","sequence_id":"0","etag":"0","name":"xxxxxxx"}], "offset":0,"limit":100,"order": [{"by":"type", "direction":"ASC"},{"by":"name","direction":"ASC"}]}
Could this be a bug in Box.com's api? Or am I doing something wrong in my api call?
-
Hey ,
I see this is your first post! Welcome to the community! Glad to see you're getting started with the Box API!
Try wrapping your URL in quotes. I've seen some of the parameter delimiters (question mark and ampersands) cause some weird behavior in the terminal unless the URL is wrapped in quotes.
If that doesn't do the trick, try Postman:
- getpostman.org
- https://developer.box.com/docs/box-postman-collection
I'm definitely able to use the limit and offset properly in my testing, so I think it's got to be a syntax error somewhere. Let me know!
Thanks,
Jason
Please sign in to leave a comment.
Comments
1 comment