question

m-pinto-2009 avatar image
0 Likes"
m-pinto-2009 asked

GetSellerList Works in API Explorer but not working in PHP /XML

I am trying to get a list of my active listings and am trying to use GetSellerList but when I run my script I get "error sending request" which is caught at my die statement but no other errors are given and can't work out why the script is not connecting to the endpoint if this is the case!

API Explorer Input:

<?xml version="1.0" encoding="utf-8"?>

<GetSellerListRequest xmlns="urn:ebay:apis:eBLBaseComponents">

<RequesterCredentials>

<eBayAuthToken>v^Xxxxxxx</eBayAuthToken>

</RequesterCredentials>

<ErrorLanguage>en_US</ErrorLanguage>

<WarningLevel>High</WarningLevel>

<DetailLevel>ReturnAll</DetailLevel>

<StartTimeFrom>2022-04-23T06:38:48.420Z</StartTimeFrom>

<StartTimeTo>2022-04-25T06:38:48.420Z</StartTimeTo>

<IncludeWatchCount>true</IncludeWatchCount>

<Pagination>

<EntriesPerPage>10</EntriesPerPage>

<PageNumber>1</PageNumber>

</Pagination>

</GetSellerListRequest>


Response Body:

<?xml version="1.0" encoding="UTF-8"?>

<GetSellerListResponse

xmlns="urn:ebay:apis:eBLBaseComponents">

<Timestamp>2022-04-25T20:02:38.808Z</Timestamp>

<Ack>Success</Ack>

<Version>1173</Version>

<Build>E1173_CORE_APISELLING_19187371_R1</Build>

<PaginationResult>

<TotalNumberOfPages>4</TotalNumberOfPages>

<TotalNumberOfEntries>40</TotalNumberOfEntries>

</PaginationResult>

<HasMoreItems>true</HasMoreItems>



PHP Script:

Variables:

$serverUrl = 'http://api.ebay.com/ws/api.dll';

$callname = "GetSellerList";

$API_Version = "967";

$siteID = "UK";


XML Body:

$requestXmlBody = '<?xml version="1.0" encoding="utf-8"?>';

$requestXmlBody .= '<GetSellerListRequest xmlns="urn:ebay:apis:eBLBaseComponents">';

$requestXmlBody .= '<ErrorLanguage>en_US</ErrorLanguage>';

$requestXmlBody .= '<WarningLevel>High</WarningLevel>';

$requestXmlBody .= '<StartTimeFrom>2022-03-21T06:38:48.420Z</StartTimeFrom>';

$requestXmlBody .= '<StartTimeTo>2022-04-21T06:38:48.420Z</StartTimeTo>';

$requestXmlBody .= '<IncludeWatchCount>true</IncludeWatchCount>';

$requestXmlBody .= '<DetailLevel>ReturnAll</DetailLevel>';

$requestXmlBody .= '<Pagination>';

$requestXmlBody .= '<EntriesPerPage>50</EntriesPerPage>';

$requestXmlBody .= '<PageNumber>1</PageNumber>';

$requestXmlBody .= '</Pagination>';

$requestXmlBody .= '</GetSellerListRequest>';


$session = new eBaySession($devID, $appID, $certID, $serverUrl, $API_Version, $siteID, $callname);

$responseXml = $session->sendHttpRequest($requestXmlBody);

!!!! And fails at line below

if(stristr($responseXml, 'HTTP 404') || $responseXml == '') { echo "Gona stop due to 404"; die('<P>Error sending request'); }


I use the same format for GetSingleItemRequest and findItemsAdvancedRequest which work fine so a bit baffelled!

Any suggestions of what could be causing this to fail please would be greatly appreciated.

Any other info required please let me know.

Thank you.










getsellerlist
10 |600

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.