Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access last or first item, Pagination or Sheet info #19

Closed
dac09 opened this issue Apr 12, 2016 · 2 comments
Closed

Access last or first item, Pagination or Sheet info #19

dac09 opened this issue Apr 12, 2016 · 2 comments

Comments

@dac09
Copy link

dac09 commented Apr 12, 2016

Hi,

First of all - great product you guys are building - I'm certainly curious what I can get done with it.

I had a few questions regarding the API:

  • Is there a quick way of accessing the first and/or last item in a sheet?
  • How do I paginate, for example if I have a huge number of rows (as I expect to have over time)?
  • Is there a way I can query book info? (So that I can access, for example the number of items in each sheet)
  • Could I somehow list a subset of items in a sheet? e.g. filter

Thanks

@jasoncrawford
Copy link
Contributor

Thanks @dac09! Some answers:

  • Pagination is done by passing limit and offset parameters, like ?limit=10&offset=20. That would get items 21–30 (counting from 1). More here: https://github.com/fieldbook/api-docs/blob/master/reference.md#pagination
  • When you paginate, you get back an object that tells you the total number of items in the sheet. So to get just the number of items in a sheet, you could query with ?limit=0, which would return no items but would include the count.
  • To get the first item in a sheet, just pass limit=1. The last item is trickier, you'd have to do this with one call to get the count, and then another call with offset=N where N is count - 1.
  • You can do simple field=value queries right now, exact match. We'll support the full query language through the API in the future. More here: https://github.com/fieldbook/api-docs/blob/master/reference.md#sheet-queries

Hope that helps!

@dac09
Copy link
Author

dac09 commented Apr 13, 2016

Thank you Jason.

I totally didn't spot reference.md - assumed docs were in progress!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants