amadeus4dev-examples / amadeus-ruby

Ruby library for the Amadeus Self-Service travel APIs
https://developers.amadeus.com
MIT License
16 stars 15 forks source link

Pagination documentation needs improvement #54

Open jtFrancisco opened 3 years ago

jtFrancisco commented 3 years ago

I am having a lot of difficulty using pagination, and the documentation on pagination in this repo and the API documentation in Amadeus's site is not clear on usage.

anthonyroux commented 3 years ago

Hi @donBigote, can you provide some concrete examples of what you are trying to achieve and what is not working/not well documented? We will take a look and see both how we can help you and how we can improve the documentation

jtFrancisco commented 3 years ago

Based on the API documentation for hotel offers https://developers.amadeus.com/self-service/category/hotel/api-doc/hotel-search/api-reference You are supposed to use page[limit] and page[offset] And then use the "next" link from the API response to show the next results.

How do I set page[limit] and page[offset] with the response = amadeus.shopping.hotel_offers.get(...? When I tried: page:{ limit: 10, offset: 1} it returned a response, but it was a strange response with 7 results.

Then, when I tried to use next(response) the API was returning the same results from the first response

Once I started using the production API, I noticed that the response for hotel offers isn't that big (like 50-60 offers). So, I decided to just get a normal response and use javascript to show and hide a certain number of offers.

I am new at working with APIs. So, a lot of my confusion is probably just from a lack of experience. Thanks for this gem and the API, it is very nice!