cod*_*Joe 28 google-calendar-api google-api
使用Google日历API v3,我在Google日历中添加了一个事件.现在我想建立一个html链接,以便有人可以点击并查看日历事件.
这是我尝试过的:
<a href="https://www.google.com/calendar/feeds/default/private/full/{{ event.googleID }}">View Google</a>
href看起来像:
https://www.google.com/calendar/feeds/default/private/full/bigstringhere1ovmuup7mjf0
问题是我得到401错误"需要授权"
如何根据Google日历ID构建查看/编辑日历活动的链接?
Kai*_*ver 37
有一种方法!要查看公共日历活动,请使用以下表单的链接:
https://www.google.com/calendar/event?eid={event-id}&ctz={timezone}
Run Code Online (Sandbox Code Playgroud)
其中{event-id}是唯一的事件ID,{timezone}是其中一个时区.
以下是一个示例:指向特定公共日历活动的链接.
如果您拥有此事件来自的日历的编辑权限,您将能够编辑该事件并查看访客列表.否则,您只需查看有关该事件的公共信息.
由于可能很难确定事件ID,因此这是一个书签,当您编辑其详细信息页面时,该书签会生成指向您的Google日历事件的链接:
javascript:(function(){ try { window.prompt('Shareable link to this event:','https://www.google.com/calendar/event?eid='+document.getElementsByClassName('ep')[0].getAttribute('data-eid')) } catch (e) {alert("Use this bookmarklet to get a shareable link to a Google Calendar event when editing its Details page.")}})()
Run Code Online (Sandbox Code Playgroud)
此书签的一个版本适用于新的(截至2017年)Google日历用户界面:
javascript:(function(){
window.prompt('Shareable link to this event:',
'https://www.google.com/calendar/event?eid='+
window.location.href.split("/").pop().split("?")[0])
})()
Run Code Online (Sandbox Code Playgroud)
(也可能是有用的,如何链接到一个特定的一天公共谷歌日历:
https://www.google.com/calendar/embed?src={calendar-id}&mode=day&dates={yyyymmdd}%2F{yyyymmdd}
Run Code Online (Sandbox Code Playgroud)
其中{calendar-id}是日历的ID,{yyyymmdd}是您要链接的日期.
可选参数包括时区以及是否显示各种项目,例如:
&ctz=Asia/Taipei&showNav=0&showPrint=0&showCalendars=0
Run Code Online (Sandbox Code Playgroud)
示例:链接到公共日历的单日.)
Fle*_*lea 10
以下是构建链接的HTML:
https://www.google.com/calendar/render?action=TEMPLATE&text=Your+Event+Name&dates=20140127T224000Z/20140320T221500Z&details=For+details,+link+here:+http://www.example.com&location=Waldorf+Astoria,+301+Park+Ave+,+New+York,+NY+10022&sf=true&output=xml
小智 6
事件URL不是日历URL.
此链接带来了解释:Google Calender v3
构建此URL的方法是:
GET https://www.googleapis.com/calendar/v3/calendars/calendarId/events/eventId
Run Code Online (Sandbox Code Playgroud)
where calendarId&eventIdare parametres.
希望这是有帮助的.
要创建用户可以公开查看事件日历的页面,有权更改日历共享设置的用户必须首先公开日历:
在 Google 日历中,点击右上角的“设置”轮。
在“设置”中,单击“日历”选项卡。
单击您正在使用的日历的名称。
接下来,单击“共享此日历”选项卡。确保从下面的屏幕截图中选中复选框(用红色圆圈圈出)。

然后,单击左上角的“日历详细信息”选项卡。
向下滚动到“日历地址”部分,如下面的屏幕截图所示。
单击“HTML”。
将出现一个弹出模式,其中包括公开访问日历所需的公共 URL。

以下是 URL 的示例:
https://www.google.com/calendar/embed?src=domain.comrandomstring@group.calendar.google.com&ctz=America/Los_Angeles&gsessionid=OK
Run Code Online (Sandbox Code Playgroud)
此外,请参阅Google 日历数据 API,了解有关创建和使用日历小工具的信息。
| 归档时间: |
|
| 查看次数: |
52408 次 |
| 最近记录: |