I am trying to get all products from a user's ebay account, but when I run my code I am only getting a few hundred. I can confirm there are 2 000 products.
How can I pull all products without using the start and end time and date parameters?
If I remove the lines of code with the <StartTimeFrom>
to <EndTimeTo>
it shows no products at all.
$url = 'https://api.ebay.com/ws/api.dll';
$user_name = "{username is in here}";
$auth_token = "{token is in here}";
for ($i = 1; $i <= 10; $i++) {
$headers = array(
'Content-Type: text/xml',
'X-EBAY-API-COMPATIBILITY-LEVEL:877',
'X-EBAY-API-DEV-NAME:177b0624-2d99-428a-8659-7404d9043c76',
'X-EBAY-API-APP-NAME:PeteNayl-d415-49bb-a950-495237441c1c',
'X-EBAY-API-CERT-NAME:6c336965-1a1f-4d11-94b1-3843c3ac995b',
'X-EBAY-API-SITEID:3',
'X-EBAY-API-CALL-NAME:GetSellerList'
);
$xml = '<?xml version="1.0" encoding="utf-8"?>
<GetSellerListRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<RequesterCredentials>
<eBayAuthToken>'.$auth_token.'</eBayAuthToken>
</RequesterCredentials>
<Pagination ComplexType="PaginationType">
<EntriesPerPage>200</EntriesPerPage>
<PageNumber>'.$i.'</PageNumber>
</Pagination>
<StartTimeFrom>2014-06-01T21:59:59.005Z</StartTimeFrom>
<StartTimeTo>2014-06-02T21:59:59.005Z</StartTimeTo>
<EndTimeFrom>2014-09-29T21:59:59.005Z</EndTimeFrom>
<EndTimeTo>2014-09-30T21:59:59.005Z</EndTimeTo>
<DetailLevel>ItemReturnDescription</DetailLevel>
<UserID>'.$user_name.'</UserID>
</GetSellerListRequest>';
...
You cannot send a request without a time range and that the period between the from and to cannot exceed 120 days. If you want to pull all the products back you are going to have to make multiple requests to GetSellerList where each request covers a particular 120 day period.
Information can be found in the eBay documentation for the both the EndTimeFrom and StartTimeFrom fields in the request. Note that the documentation does not say that the fields are required, but it you do not include them in your request a Failure value will be returned in the Ack field of the response.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With