Changing "per_page" value and reducing API calls

Roland's Avatar

Roland

13 Aug, 2011 10:17 PM

Hi There,

I have created a small web app that keeps track of open 'tickets' in each of our categories. However it takes a while to load as results from the Tender API are limited to 30 (the 'per_page' value), and hence several API calls need to be made to make sure the information from all the 'pages' gets collated, and none is missed. The only other option seems to use the 'since' option, which would work now, but would no doubt need updating from time to time.

So, is there a way to increase the value to a higher number? Say for example 200, so that only one API call would be needed ?

Many thanks.

  1. 1 Posted by Roland on 13 Aug, 2011 10:40 PM

    Roland's Avatar

    Worked it out, please close.

    Many thanks.

  2. 2 Posted by Roland on 13 Aug, 2011 10:56 PM

    Roland's Avatar

    Actually this is not resolved please help! :(

  3. Support Staff 3 Posted by Courtenay on 14 Aug, 2011 11:15 AM

    Courtenay's Avatar

    Hey Roland,

    can't do 200 as it uses too much memory on our server. Which API calls
    do you want to have more results?

  4. 4 Posted by roland on 14 Aug, 2011 03:28 PM

    roland's Avatar

    Hi Courtenay,

    Thanks for your response. The call is to "https://api.tenderapp.com/website/discussions", which is automatically paginated to 30 results. This means that i have to poll the API again with "?page=2" then "?page=3" and so on.

    I've managed to reduce the number of calls by using the "https://api.tenderapp.com/website/discussions/open" URI, so only 2 calls need to be made, I understand this is only a problem when there is 30+ open discussions, but I would have thought being able to increase the page size higher would still be more efficient .

    Many thanks

  5. Support Staff 5 Posted by Courtenay on 14 Aug, 2011 03:42 PM

    Courtenay's Avatar

    OK. I think we're going to increase the number of records to at least
    50, so make sure you don't have 30 hardcoded anywhere :)

  6. 6 Posted by Roland on 14 Aug, 2011 04:51 PM

    Roland's Avatar

    Wow, thanks! :)

  7. Amanda closed this discussion on 15 Aug, 2011 05:44 PM.

Discussions are closed to public comments.
If you need help with Tender please start a new discussion.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac