ebay The API call "ApplicationAggregate" is invalid or not supported in this release 错误

ebay The API call "ApplicationAggregate" is invalid or not supported in this release error

我需要在我的应用程序中获取 ebay api 限制使用。我正在尝试使用此 post 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;
}

我收到这个错误:

Unsupported API call.The API call "ApplicationAggregate" is invalid or not supported in this release.2ErrorRequestError92318451796

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

谢谢

问题出在以下行:

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

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

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