1

因此,我看到使用 GetSellerList 操作的 Trading API 有一些不寻常的活动。在我指定 ANY 值时进行任何调用都会导致我只返回我的 ebay 项目。我正在考虑拉另一个用户的卖家列表,而不是我自己的。我尝试了多个 API 版本,但我的脚本使用的是 871。

<?php

function print_d($array){    echo "<pre>\n";    print_r($array);    echo "</pre>\n";}

$mytoken = "*************mytoken ****************";
$devId = "**************devId ***************";
$appId = "*************appId ***************";
$certId = "**************certId **************";

$wsdl_url = 'http://developer.ebay.com/webservices/latest/ebaySvc.wsdl';

$apiCall = "GetSellerList";

$credentials = array('AppId' => $appId, 'DevID' => $devId, 'AuthCert' => $certId);

$client = new SOAPClient($wsdl_url, array('trace' => 1, 'exceptions' => 0, 'location' => "https://api.ebay.com/wsapi?callname=$apiCall&appid=$appId&siteid=0&version=871&Routing=new"));

$eBayAuth = array('eBayAuthToken' => new SoapVar($mytoken, XSD_STRING, NULL, NULL, NULL, 'urn:ebay:apis:eBLBaseComponents'),
                    'Credentials' => new SoapVar ($credentials, SOAP_ENC_OBJECT, NULL, NULL, NULL, 'urn:ebay:apis:eBLBaseComponents'));  

$header_body = new SoapVar($eBayAuth, SOAP_ENC_OBJECT);    

$header = array(new SOAPHeader('urn:ebay:apis:eBLBaseComponents', 'RequesterCredentials', $header_body));                

//set the API call parameters

$params = array('UserID'=>'**userid**','DetailLevel'=>'ReturnAll','GranularityLevel'=>'Coarse','WarningLevel'=>'High','IncludeWatchCount'=>'true','Pagination'=>array('EntriesPerPage'=>20,'PageNumber'=>1),'Version' => 871, 'StartTimeFrom'=>'2019-07-01T01:01:02.768Z' ,'StartTimeTo'=>'2019-08-22T01:01:02.768Z');  

$request = $client->__soapCall($apiCall, array($params), NULL, $header);  //make the actual API call

print_d($request);



?>
4

0 回答 0