> -----Original Message-----
> From: Nik Martin [mailto:[email protected]]
> Sent: Friday, 11 January 2013 9:22 PM
> To: [email protected]
> Subject: Usage API Paging question
>
> Could someone post some pseudocode on how to use paging when
> processing usage reports? I'm having a bit of trouble getting my head
> wrapped around this.
>
> Here's pseudocode for what I have right now:
> default.page.size: 2000
>
> var page=1
> usage = api.listusage{domain:xxx, page:page, pagesize: 2000, startdate:xx-
> xx-xxxx, enddate: xx-xx-xxxx};
>
> while usage.length = 2000{
> //there are more records
> page+=1;
> usage= usage + api.listusage{domain:xxx, page:page, pagesize:
> 2000,
> startdate:xx-xx-xxxx, enddate: xx-xx-xxxx}; }
[KK] This should instead be: usage= api.listusage{domain:xxx, page:page,
pagesize: 2000, startdate:xx-xx-xxxx, enddate: xx-xx-xxxx};
>
> Is this in line with what I should be doing? As long as the number of records
> is 2000, it can be assumes that there are more records, so I should fetch
> until
> usage.length < 2000.
>
[KK] Yes, you need to fetch until length < 2000
>
> Regards,
>
> Nik
>
> Nik Martin
> +1.251.243.0043 x1003
> Relentless Reliability