Skip to main content
Published: October 05 2006, 3:17:00 PMUpdated: November 28 2020, 2:51:33 PM

Why does GetAccount not return TotalNumberOfEntries in the response for Pagination?

Summary

It is a feature limitation that GetAccount does not return TotalNumberOfEntries in the response for pagination.  It does return the tags TotalNumberOfPages and HasMoreEntries, based on which you can determine how many calls you will need to make to get all the AccountEntries.


Detailed Description

If you need to determine now many call you need to make to GetAccount you can find that out by making use of the tags TotalNumberOfPages or HasMoreEntries.  If you use TotalNumberOfPages, then you need to make the call to GetAccount with Pagination.PageNumber ranging from 1 to TotalNumberOfPages.  If you decide to use HasMoreEntries, then you make the call iteratively by incrementing Pagination.PageNumber till it is false.

Here is an example of GetAccountResponse when the call is made the first time. 

<?xml version="1.0" encoding="utf-8"?>
...
<
GetAccountResponse xmlns="urn:ebay:apis:eBLBaseComponents">
  <
PaginationResult>
    <
TotalNumberOfPages>59</TotalNumberOfPages>
  </
PaginationResult>
  <
HasMoreEntries>true</HasMoreEntries>
  <
EntriesPerPage>50</EntriesPerPage>
  <
PageNumber>1</PageNumber>
</
GetAccountResponse>

In this case, you need to make the GetAccount call 59 times to get all the AccountEntries.  When you make the call with Pagination.PageNumber set to 59, HasMoreEntries will be false.  It is at that point you stop the iteration.


Version Info

The code example above was based on the versions specified below:

API Schema Version 479


Additional Resources

How well did this answer your question?
Answers others found helpful