超过了Fusion表身份验证每日限制


Fusion tables authentication daily limit exceeded

使用Oauth2 access_token:从这段代码中

$acsToken = json_decode($client->getAccessToken())->{'access_token'};
$arrHeader = array('Content-Type'=>'application/json', 'Authorization'=>'Bearer '.$acsToken);
$ch = curl_init( 'https://www.googleapis.com/fusiontables/v1/query?sql=SELECT%20UserID%20FROM%201DGQPfPkjgcNVUc3ndplxNBlET9TlwoVcQw5_jVA');
curl_setopt( $ch, CURLOPT_HTTPHEADER, $arrHeader);
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt( $ch, CURLOPT_HEADER, 0);
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec( $ch );
if($response === false){
    echo 'Curl error: ' . curl_error($ch);
} else {
    echo "<br /> response: ".$response; 
}

这就是返回的内容。

响应:{"error":{"errors":[{"domain":"usageLimits","reason":"dailyLimitExceededUng","message":"Daily Limit Exceeded"。请注册","extendedHelp":"https://code.google.com/apis/console"}],"code":403,"message":"超过每日限额。请注册"}}

根据api控制台,在过去的28天里,我收到了50个请求。融合表的最大限制是每天25000张。所以我不应该超过极限。

我以前没有使用过cURL。我的cURL请求格式是否不正确?

您需要将您的API密钥作为第二个名为key的参数添加到您的请求中。

https://www.googleapis.com/fusiontables/v1/query?sql=<query>&key=<your API key>

您可以在Google API控制台的"API访问"选项卡上找到您的API密钥。