Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/firebase/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Zend framework 谷歌日历API密钥不工作_Zend Framework_Google Calendar Api_Google Api Php Client - Fatal编程技术网

Zend framework 谷歌日历API密钥不工作

Zend framework 谷歌日历API密钥不工作,zend-framework,google-calendar-api,google-api-php-client,Zend Framework,Google Calendar Api,Google Api Php Client,因此,从这里访问: 在我的项目中,我刚刚启用了日历API 现在,我正在尝试做以下工作:(我的钥匙因为明显的原因而被隐藏) 我做错了什么?我正在使用服务器API密钥。几天前,我遇到了类似的问题。在www.google.com/calendar/->我的日历->日历设置和日历地址中检查您的日历ID。Id应该包含字母和数字,而不是电子邮件地址 我明白了。日历ID必须是URL编码的 $client = new Zend_Http_Client('https://www.googleapis.com/ca

因此,从这里访问:

在我的项目中,我刚刚启用了日历API

现在,我正在尝试做以下工作:(我的钥匙因为明显的原因而被隐藏)


我做错了什么?我正在使用服务器API密钥。

几天前,我遇到了类似的问题。在www.google.com/calendar/->我的日历->日历设置和日历地址中检查您的日历ID。Id应该包含字母和数字,而不是电子邮件地址

我明白了。日历ID必须是URL编码的

$client = new Zend_Http_Client('https://www.googleapis.com/calendar/v3/calendars/en.usa#holiday@group.v.calendar.google.com/events');
$client->setParameterGet(array(
    'key' => '########################',
));
$feed = $client->request()->getBody();

echo "<pre>";
print_r($feed);
exit;
{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "required",
    "message": "Login Required",
    "locationType": "header",
    "location": "Authorization"
   }
  ],
  "code": 401,
  "message": "Login Required"
 }
}