Php 从google日历API获取数据时出错
这是我的密码Php 从google日历API获取数据时出错,php,Php,这是我的密码 use Google_Client; use Google_Service_Calendar; class GController extends BaseController { public function client() { $client = new Google_Client(); $client->setAuthConfig('/mnt/d/xampp/htdocs/test/client_secret.json
use Google_Client;
use Google_Service_Calendar;
class GController extends BaseController
{
public function client()
{
$client = new Google_Client();
$client->setAuthConfig('/mnt/d/xampp/htdocs/test/client_secret.json');
$client->addScope(Google_Service_Calendar::CALENDAR);
$guzzleClient = new \GuzzleHttp\Client(array('curl' => array(CURLOPT_SSL_VERIFYPEER => false)));
$client->setHttpClient($guzzleClient);
return $client;
}
public function index()
{
$service = new Google_Service_Calendar($this->client());
$calendarId = 'primary';
$results = $service->events->listEvents($calendarId);
return $results->getItems();
}
}
我得到了这个错误
"message": [
"{\n \"error\": {\n \"errors\": [\n {\n \"domain\": \"usageLimits\",\n \"reason\": \"dailyLimitExceededUnreg\",\n \"message\": \"Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.\",\n \"extendedHelp\": \"https://code.google.com/apis/console\"\n }\n ],\n \"code\": 403,\n \"message\": \"Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.\"\n }\n}\n"
],
我该怎么做才能解决这个问题。?
对不起,我是初学者
我的参考是我觉得解决这个问题很容易。您必须验证您的客户端,并停止匿名使用它 您的错误消息显示: 超出未经验证使用的每日限制继续使用需要注册。
我很清楚为什么会出现此错误。
超出了未经验证使用的每日限制。继续使用需要注册。
这很清楚;)
"message": [
"{\n \"error\": {\n \"errors\": [\n {\n \"domain\": \"usageLimits\",\n \"reason\": \"dailyLimitExceededUnreg\",\n \"message\": \"Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.\",\n \"extendedHelp\": \"https://code.google.com/apis/console\"\n }\n ],\n \"code\": 403,\n \"message\": \"Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.\"\n }\n}\n"
],