I'm using the event registrant list API to get the list of registrants for an event. I have 8 registrants shown in the Constant Contact UI. The API returns two pages of registrants. The second page appears to be a duplicate of the first.
When I get the data for the first page, the header of the atom data is:
<atom:id>tag:api.constantcontact.com,2010:/ws/customers/0017score/events/a07e4el6neb7e8c0e4b/registrants</atom:id> <atom:link rel="current" href="/ws/customers/0017score/events/a07e4el6neb7e8c0e4b/registrants"/> <atom:link rel="first" href="/ws/customers/0017score/events/a07e4el6neb7e8c0e4b/registrants"/> <atom:link rel="next" href="/ws/customers/0017score/events/a07e4el6neb7e8c0e4b/registrants?pageNumber=1"/>
It clearly shows there is a "next" page to retrieve. So I dutifully retrieve the next page with the ?pageNumber=1 URI. The header for that second page comes back as:
<atom:title>Registrants</atom:title> <atom:updated>2011-07-29T14:50:33.015-04:00</atom:updated> <atom:id>tag:api.constantcontact.com,2010:/ws/customers/0017score/events/a07e4el6neb7e8c0e4b/registrants</atom:id>
It seems to me that if there is a link with a rel="next" attribute I should follow it (that's how other APIs work). Am I instead supposed to know that:
a) the pageNumber=1 link is actually a duplicate if there is only a single page (what do I do to know when there is a pageNumber=2 inside page 1?)
b) call pageNumber=1 initially, rather than with no parameters
c) ignore the result of any page where I have already seen the atom:id ?
I feel like this worked fine for the event list, and seems to be working differently for the registrant list.
Any suggestions?
Phil
Solved! Go to Solution.
Hey Phil,
I have looked into this issue and I believe that there is a defect in our system but the work around would be to use the URI of:
https://api.constantcontact.com/ws/customers/0017score/events/a07e4el6neb7e8c0e4b/registrants?pageNu...
Then on that request if you have more than 50 registrants you will see that there will be the following:
<atom:link rel="current" href="/ws/customers/{username}/events/{event-id}/registrants?pageNumber=1"/> <atom:link rel="first" href="/ws/customers/{username}/events/{event-id}/registrants"/> <atom:link rel="next" href="/ws/customers/{username}/events/{event-id}/registrants?pageNumber=2"/>
That way you will have your current page and your next page. The first page does repeat itself and I am going to look into a more permanent resolution for you.
Thanks,
Hey Phil,
I have looked into this issue and I believe that there is a defect in our system but the work around would be to use the URI of:
https://api.constantcontact.com/ws/customers/0017score/events/a07e4el6neb7e8c0e4b/registrants?pageNu...
Then on that request if you have more than 50 registrants you will see that there will be the following:
<atom:link rel="current" href="/ws/customers/{username}/events/{event-id}/registrants?pageNumber=1"/> <atom:link rel="first" href="/ws/customers/{username}/events/{event-id}/registrants"/> <atom:link rel="next" href="/ws/customers/{username}/events/{event-id}/registrants?pageNumber=2"/>
That way you will have your current page and your next page. The first page does repeat itself and I am going to look into a more permanent resolution for you.
Thanks,
Thanks. I'll code it that way for now, since it shouldn't break (I hope) when the defect is resolved.
Phil