适用于活动的Google Calendar API v3 404 [英] Google Calendar API v3 404 for Events

查看:55
本文介绍了适用于活动的Google Calendar API v3 404的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要使用Google Calendar v3 API来完成一个相对简单的任务,但是我一直遇到404错误.我只需要访问一个日历(属于我的客户端)并通过Javascript获取只读事件数据(仅将协议与Ajax调用配合使用),所以我试图避免使用身份验证.

I've got a relatively simple task I'm trying to accomplish with the Google Calendar v3 API, but I keep running into 404 errors. I only need to access one calendar (belonging to my client) and get read-only event data via Javascript (just using the protocol with an Ajax call), so I'm trying to avoid using authentication.

我通过转到日历共享设置,单击与其他人共享此日历",然后选择将该日历公开."来公开该日历.但是,我公开的唯一选择是仅查看忙/闲(隐藏)详细信息).

I made the calendar public by going to the calendar sharing settings clicking "Share this calendar with others" and then choosing "Make this calendar public. However, the only option I have for public is "See only free/busy (hide details)."

意识到这一点,我编辑了每个事件以将类型专门设置为公开".

Having realized that, I edited each event to specifically set the type to "public."

现在,我可以从日历资源中获取一个eventList,但是数组中每个项目只有几个详细信息(请参见下文).而且,当我尝试访问单个事件时,我得到了404.

Now, I'm able to get a eventList from the calendar resource, but there are only a few details for each item in the array (see below). And, when I try to access the individual event, I get a 404.

尝试使用基本的测试日历,我可以肯定地确定了日历共享设置.我很确定,我客户的日历和我使用的测试日历之间的主要区别在于,他的日历是Google Apps for business帐户的一部分.

Having tried with a basic test calendar, I'm fairly certain the calendar sharing settings are the issue. The main difference between my client's calendar and the test calendar I used is that his calendar is a part of a Google Apps for business account, I'm fairly certain.

我可以编辑日历本身中的任何设置,以使API正常工作而不必使用auth访问数据吗?或者,在业务应用程序设置中是否可以我更改客户的选项?再次,我说的是只使用Javascript在一个特定的日历上执行GET请求,因此身份验证是不可取的.

Is there any setting in the calendar itself I can edit to make the API work without having to use auth to access the data? Or, is there an option in the business apps settings I can have my client change? Again, I'm talking about only doing GET requests on one specific calendar using Javascript, so authentication is undesirable.

这里真的没有代码可以显示,因为我只是通过URI获取数据.在API文档中使用资源管理器工具时,我遇到了相同的问题(404).但是,正如您可能期望的那样,当我使用该资源管理器工具进行身份验证时,事件显示没有问题.

There's really no code I can show here because I'm just grabbing the data via the URI; I have the same problem (the 404) when using the explorer tool in the API docs. However, as you might expect, when I authenticate with that explorer tool, the events appear with no problems.

eventList中的示例项目:

Sample item from the eventList:


  {
   "kind": "calendar#event",
   "id": "(idremoved)",
   "status": "confirmed",
   "updated": "2012-05-29T21:06:42.000Z",
   "start": {
    "dateTime": "2012-06-18T19:00:00-05:00"
   },
   "end": {
    "dateTime": "2012-06-18T21:00:00-05:00"
   },
   "visibility": "public"
  }

推荐答案

我正在使用以下内容阅读Google Apps for Education日历,该日历具有与企业版相同的api和安全限制.

I'm using the following to read Google Apps for Education calendars, which has the same api and security restrictions as for Business.

获得公共日历地址后,我决定解析日历的完整版本,而不是基本版本:

After getting the public calendar address, I decided to parse the full version of the calendar instead of the basic version:

https://www.google.com/calendar/feeds/your_calendar_id_here%40gmail.com/public/full

根据我所看到的如果您的日历是公开的日历,您的事件也将是公开的.您将要确保仅通过粘贴url就可以在浏览器中访问日历的公众.同时检查活动是否也公开.确保日历是公开的,但未选中仅共享我的忙/闲信息(隐藏详细信息)"框

from what I've seen if your calendar is public, your events will be as well. You will want to make sure that the public for your calendar is accessible in your browser by just pasting the url. Check that events are also public by doing that as well. Make sure that the calendar is public but the "Share only my free/busy information (Hide details)" box is unchecked

这篇关于适用于活动的Google Calendar API v3 404的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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