Esendex API - Paged results?

Help with the Esendex API

Esendex API - Paged results?

Postby lukebarton » Thu Jul 15, 2010 8:34 pm

Hi,

I can't seem to find any reference as to how different pages are retrieved via this API?

I've noticed that if I request with ?startindex=1 or ?count=1 I get a 404, but any other keywords seem to be ignored. I have 2 messages and am trying to either move the startindex to 1 or limit the count to 1 - just for testing purposes.

Best Regards,
Luke
lukebarton
 
Posts: 2
Joined: Thu Jul 15, 2010 8:29 pm

Re: Esendex API - Paged results?

Postby Leanne » Mon Jul 19, 2010 11:19 am

Hi Luke,
Thanks for getting in touch.

Paging is supported by using both startIndex and count query parameters. You cannot just specify one as the API will not know what size of result set you are requesting. With neither parameter it will return the default first page of a fixed size.

There are three values returned with paged collections: startIndex, count and totalcount.
E.g. <messageheaders startindex="0" count="15" totalcount="24">

If you wanted to request the second page you would send a request to
http://api.esendex.com/v1.0/inbox/messa ... 5&count=15

The response you would get would indicate the size of results you got back
<messageheaders startindex="15" count="9" totalcount="24">

9 is the total amount of records on the final second page as there were only 24 records.
The totalcount may change between page requests as new messages enter your inbox. You can use this number to generate the total number of available pages.

If you have any other questions, please get in touch.

Many thanks,
Leanne
 
Posts: 102
Joined: Thu Mar 04, 2010 12:35 am


Return to API



cron