本文介绍了Google 日历 API 移动事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

交易来了,

在 googles 开发者网站上,他们在每个 api 函数描述的底部都有一个试用 api 的工具,特别是我使用的是日历 api(它说使用下面的 API 资源管理器...):https://developers.google.com/google-apps/日历/v3/reference/events/get

On googles developer website they have at the bottom of each api function description a tool to try out the api, specifically I am using the calendar api (where it says " Use the APIs Explorer bellow to ...): https://developers.google.com/google-apps/calendar/v3/reference/events/get

当您输入日历 ID 和 eventID 时,此调用将返回一个事件.在打开 OAuth2.0 小开关并输入我的日历 ID 和我的事件 ID 后,它会返回一个包含事件详细信息的 200 ok 响应.

This call returns an event when you enter a calendar ID and an eventID. After switching the little OAuth2.0 switch on and entering my calandarID and an event ID of mine it returns a nice 200 ok response with the event details.

问题来了:我转到日历 api 中的移动功能:https://developers.google.com/google-apps/日历/v3/reference/events/move

Heres the problem:I go over to the move function in the calendar api:https://developers.google.com/google-apps/calendar/v3/reference/events/move

并再次填写我的日历 ID,其中包含我要移动的事件、事件 ID(与之前相同)和目标日历 ID(我的其他 gmail 帐户).但在执行此操作时,我得到一个红色框,显示未找到资源",响应为 404.

And fill in once again my calendar ID containing the event I want to move, the event ID (same as before) and the destination calendar ID (my other gmail account). but on executing this I get a red box with "the resource was not found" and the response is a 404.

奇怪的是,我已经能够通过实际的谷歌日历网站进入编辑事件 -> 下拉:日历 -> 更改所有者,我得到一个框来填写新的日历 ID,它成功地转到我的另一个 Gmail.当我通过 GUI 尝试时,两个日历都不公开,现在使用 API 时也不公开.我最好希望他们保持这种状态.

Weird thing is I have been able to do this via the actual google calendar website by going into edit event -> drop down: calendar -> change owner, I get a box to fill in new calendar ID and it successfully went to my other gmail. Both calendars where not public when I tried via the GUI and are not public now when using the API. Preferably I want them to stay that way.

有什么想法为什么移动日历事件的 api 对我不起作用?

Any ideas why the api for moving a calendar event is not working for me?

推荐答案

要使用 events.move 移动事件,您应该对两个日历都具有写入权限.我试图移动到不同的 Gmail 帐户,但它给出了 404 错误.但是当我尝试转向辅助日历时,它对我有用.developer.google.com/google-apps/calendar/concepts

To move an event using events.move, you should have write access to both the calendars. I tried to move to different gmail account but it gave 404 error. But when I tried with moving to secondary calendar, it worked for me. developers.google.com/google-apps/calendar/concepts

这篇关于Google 日历 API 移动事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-17 01:37
查看更多