【问题标题】:ebay The API call "ApplicationAggregate" is invalid or not supported in this release errorebay API 调用“ApplicationAggregate”无效或不支持此版本错误
【发布时间】:2017-07-25 21:48:41
【问题描述】:

我需要在我的应用程序中获取 ebay api 限制使用。我正在尝试使用这篇文章中的代码eBay API - check Finding API calls count?

这是我的代码示例:

function getEbayApiUsage(){
    $ebayCredentials = $this->getEbayCredentials();   
    $token = $ebayCredentials['token'];  
    $XMLData = '<?xml version="1.0" encoding="utf-8"?>
        <GetApiAccessRulesRequest xmlns="urn:ebay:apis:eBLBaseComponents">
          <RequesterCredentials>
            <eBayAuthToken>'.$token.'</eBayAuthToken>
          </RequesterCredentials>
        </GetApiAccessRulesRequest>';
        $reults = $this->callEbayAPI($XMLData, "ApplicationAggregate");
        return $reults;
}    
function callEbayAPI($XMLData, $APICallName) {
    $COMPATIBILITYLEVEL = $this->COMPATIBILITYLEVEL;
    $DEVNAME = $this->DEVNAME;
    $APPNAME = $this->APPNAME;
    $CERTNAME = $this->CERTNAME;
    $SiteId = $this->SiteId;
    $eBayAPIURL = $this->eBayAPIURL; 
    $header = array(
        "X-EBAY-API-COMPATIBILITY-LEVEL: $COMPATIBILITYLEVEL",
        "X-EBAY-API-DEV-NAME: $DEVNAME",
        "X-EBAY-API-APP-NAME: $APPNAME",
        "X-EBAY-API-CERT-NAME: $CERTNAME",
        "X-EBAY-API-SITEID: $SiteId",
        "X-EBAY-API-CALL-NAME: " . $APICallName
    );    
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $eBayAPIURL);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $XMLData);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    $results = curl_exec($ch);
    curl_close($ch);    
    return $results;
}

我收到了这个错误:

不支持的 API 调用。API 调用“ApplicationAggregate”无效或 此版本不支持。2ErrorRequestError92318451796

你能帮我获取api使用限制吗?

谢谢

【问题讨论】:

    标签: php ebay-api


    【解决方案1】:

    问题在于这一行:

    $reults = $this->callEbayAPI($XMLData, "ApplicationAggregate");
    

    callEbayAPI 需要您要调用的 API 操作的名称。在本例中,您调用的是 GetApiAccessRules。正确的代码应该是:

    $reults = $this->callEbayAPI($XMLData, "GetApiAccessRules");
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-10-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-09-10
      • 1970-01-01
      • 2010-09-27
      相关资源
      最近更新 更多