从公共Google日历获取JSON [英] Get JSON from a public Google Calendar

查看:132
本文介绍了从公共Google日历获取JSON的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何获取公开 Google日历的事件JSON?我有它ID,但没有访问权限.我不想更改其事件,也无需登录.

How can I get a JSON with the events of a public Google Calendar? I have it's ID but no acess to it. I don't want to change its events, nor log in.

我想从中获取一个JSON与我的PHP/MySql数据库同步.

I would like get a JSON from it to sync with my PHP/MySql database.

尝试了https://www.googleapis.com/calendar/v3/calendars/{calendarId}

但出现登录错误:

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "required",
    "message": "Login Required",
    "locationType": "header",
    "location": "Authorization"
   }
  ],
  "code": 401,
  "message": "Login Required"
 }
}

推荐答案

您的日历必须公开共享! 如果您仅共享了忙/闲状态,则此方法有效:

Your calendar have to be shared publicly! This one works if you have shared only free/busy status:

http://www.google.com/calendar/feeds/{calendarId}@group.calendar.google.com/public/basic?orderby=starttime&sortorder=ascending&futureevents=true&alt=json

详细信息-仅在完全公开共享日历的情况下,此提示才会显示

Full details - this one wotrks only if calendar is shared fully publicly

http://www.google.com/calendar/feeds/{calendarId}@group.calendar.google.com/public/full?orderby=starttime&sortorder=ascending&futureevents=true&alt=json

或者只是忙碌

http://www.google.com/calendar/feeds/{calendarId}@group.calendar.google.com/public/free-busy?orderby=starttime&sortorder=ascending&futureevents=true&alt=json

参数 orderby sortorder 未来事件是可选的,但稍后可能会对您有所帮助:)

Parameters orderby, sortorder and futureevents are optional but might help you later :)

这篇关于从公共Google日历获取JSON的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆