【发布时间】:2015-08-25 01:22:27
【问题描述】:
这是一个新手问题,我还不习惯Google API
嗨,
我正在使用 Google 提供的代码 (https://developers.google.com/google-apps/calendar/downloads),其中包含一些示例(最初是因为它看起来更最新)。
我正在成功检索日历,如示例“calendar/simple.php”所示(OAuth2 设置正确)。
在那之后,我正在这样做并且它可以工作(这是一个不必要的代码,只是用于检查是否可以正确检索事件而没有任何错误):
$test = $cal->events->get("calendar@gmail.com","longeventcodegivenbygoogle");
现在,我希望能够设置特定事件的一些值。
$event = new Event();
$event->setLocation('Somewhere');
$test = $cal->events->update("calendar@gmail.com","longeventcodegivenbygoogle",$event);
但它给了我:
( ! ) Fatal error: Uncaught exception 'apiServiceException' with message 'Error calling PUT https://www.googleapis.com/calendar/v3/calendars/calendar@gmail.com/events/longeventcodegivenbygoogle?key=myapikey: (400) Required' in C:\wamp\www\test\Gapi3\src\io\apiREST.php on line 86
( ! ) apiServiceException: Error calling PUT https://www.googleapis.com/calendar/v3/calendars/calendar@gmail.com/events/longeventcodegivenbygoogle?key=myapikey: (400) Required in C:\wamp\www\test\Gapi3\src\io\apiREST.php on line 86
我做错了什么?
感谢您的帮助。
【问题讨论】: