php - 使用带有 PHP 的 Google API 获取日历事件时出现 404 错误
问题描述
尝试通过 API 访问 Google 日历时,我在 PHP 中收到此错误:
PHP:
require APPPATH . "third_party/google-api-php/src/Google/autoload.php";
$this->client = new Google_Client();
$this->client->setApplicationName('Google Calendar Api');
$this->client->setAuthConfigFile('<PATH TO JSON FILE>');
$this->client->setDeveloperKey('<DEVELOPERKEY>');
$this->client->setAccessType('offline');
$this->client->setApprovalPrompt('consent');
$this->client->setIncludeGrantedScopes(true);
$this->client->addScope(Google_Service_Calendar::CALENDAR);
PHP:
$results = $this->googlecalendar_model->calendar->events->listEvents($calendarId, $optParams);
关于 404 错误原因的任何想法?
解决方案
推荐阅读
- java - 可以运行jar文件。Maven 构建后的 JNI 错误。类路径可以被破坏
- jquery - MVC模型数据使用jquery onclick函数分配标签值
- swift - Swift Firebase 从数据库显示到 tableview 中的 label.text
- python - 编译python项目
- html - 如何在文本区域内放置一个浮动按钮?
- python - 函数返回函数
- java - MVP 到 MVVM Android
- graphql - 使用来自数据对象的变量的 GraphQL 查询
- kubernetes - 使用 kubeadm 构建裸机 Kubernetes 集群
- c++ - 用 DWrite 绘制的文字模糊