繁体   English   中英

使用API​​从Google日历删除事件

[英]Delete events from google calendar using api

我正在尝试使用api从Google日历中删除事件:

$service->events->delete('primary', 'eventId');

我得到了这个错误:

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "notFound",
    "message": "Not Found"
   }
  ],
  "code": 404,
  "message": "Not Found"
 }
}

我也尝试过使用api Explorer,并发生相同的错误。

有人知道这是什么问题吗?

我在使用python时遇到了类似的问题。 我做错的两件事:

  • 确保您的范围设置为“ https://www.googleapis.com/auth/calendar ”而非“只读”版本
  • 在python中,您需要在delete()调用的末尾添加.execute() 我敢打赌在php中有类似的东西吗?

从文档复制代码段时遇到了这个问题。 然后我注意到该方法对日历ID一无所知。

$service->events->delete('calendarId', 'eventId');

也许这有帮助

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM