|GAN API - More than 100 Advertisers||esnagel||3/26/12 11:55 AM|
On http://code.google.com/apis/gan/v1beta1/advertisers/list.html I see the maxResults is 100. If I want to get all of my advertisers, and I have more than 100 relationships, is there a way to specify a starting point, and get them 100 at a time?
|Re: GAN API - More than 100 Advertisers||InspiredArk||4/24/12 3:31 PM|
use the nextPageToken
|Re: GAN API - More than 100 Advertisers||InspiredArk||4/25/12 4:30 PM|
|Re: GAN API - More than 100 Advertisers||esnagel||5/16/12 10:54 AM|
Maybe I'm doing something wrong, but I'm requesting
and I get back 100 requests, but I only have 34 advertisers in my account, so each is repeated 3 times. Also, on this request, I get back
$oJson->nextPageToken is d30ffa0128b1,32
If there are only 34 results, why does the API repeat them 3 times, and tell me to keep looking onto the next page? When I specify the pageToken on subsequent requests, the list repeats, and gives me another nextPageToken, which puts me in an infinite loop.
|Re: GAN API - More than 100 Advertisers||InspiredArk||5/16/12 1:04 PM|
There is a bug in the API that means you'll get back exactly the number of results you request - so if you request 90, results will be repeated until the number of results is 90. I've reported this bug in previous mails.
Personally I take the approach of filtering out duplicates on the client side, then if the number of results with duplicates removed == 100 (or whatever limit I set) then, and only then, do I request the next page.
Hope that helps a little,