【问题标题】:Synchronize database data with google calendar using google calendar api使用谷歌日历api将数据库数据与谷歌日历同步
【发布时间】:2016-08-30 18:06:18
【问题描述】:

目前,我可以从谷歌日历中检索特定日历的事件,例如主日历。我已经参考了这个链接https://developers.google.com/google-apps/calendar/quickstart/php#prerequisites 从谷歌日历中检索事件。

但是,我想要的是当数据库中有新数据/事件时,它会将来自数据库的事件插入到谷歌日历中。同样,当从数据库中删除数据/事件时,谷歌日历中的相同数据/事件也将被删除。除此之外,当数据库发生更新时。例如将事件标题从 A 更改为 B。因此,谷歌日历中的相同事件也应该更新。换句话说,数据库数据应该与谷歌日历同步。

下面的截图是数据库中的数据。

以下链接用于获取、插入、删除、更新谷歌日历中的事件。

https://developers.google.com/google-apps/calendar/v3/reference/events/get

https://developers.google.com/google-apps/calendar/v3/reference/events/insert

https://developers.google.com/google-apps/calendar/v3/reference/events/delete

https://developers.google.com/google-apps/calendar/v3/reference/events/update

非常感谢任何帮助,谢谢。

【问题讨论】:

标签: php mysql calendar google-calendar-api


【解决方案1】:

首先需要CLIENT_ID、CLIENT_SECRET、API_KEY 进行同步。 有一个功能可以连接到谷歌日历,就好像它打印存储在数据库中的数据一样。开尔文,我不知道你在哪里添加数据, 如果您在网页屏幕上添加数据 DB,请在如下所示的函数中添加插入 DB 所需的列值。

【讨论】:

  • function insertEvent{ gapi.client.load('calendar', 'v3', function () { var event = { summary: title description: description, // 내용 start: { dateTime: strDate ( startDate) }, end: { dateTime: endDate }, iCalUID: Calendar uniq key(我用序列解决了这个问题。), 分享: [{ "email": (googlecaledar id) }] }; var request = gapi.client. calendar.events.insert({ calendarId: email, resource: event }); request.execute(function (event) { }); });}
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-01-31
  • 2017-10-12
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多