bugsnag / bugsnag-api-ruby

BugSnag API toolkit for Ruby
Other
21 stars 15 forks source link

More rigorous pagination example #9

Closed sionide21 closed 7 years ago

sionide21 commented 7 years ago

The way this example was written, I thought the last_response method was updated with each get call such that I could get multiple pages as follows:

errors = Bugsnag::Api.errors("project-id", per_page: 100)
errors.concat Bugsnag::Api.last_response.rels[:next].get.data
errors.concat Bugsnag::Api.last_response.rels[:next].get.data
errors.concat Bugsnag::Api.last_response.rels[:next].get.data
...

This turns out to simply load the same page over and over.

Hopefully this new example makes it clear how to get pages 3 and up.

loopj commented 7 years ago

thanks @sionide21!