这是一个新手问题,我还不习惯 Google API
你好,
我正在使用谷歌提供的代码(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
我做错了什么?
谢谢你的帮助。