恢复“已取消”的任务使用 Google 日历 API 进行活动?

发布于 2024-09-01 23:00:56 字数 361 浏览 8 评论 0原文

我正在尝试使用 Google Calendar API 将事件的状态从“已取消”更改回“已确认”(我正在使用 .NET,但任何语言的答案都会有帮助),但我收到 GDataRequestException 错误:

“你可以” t 修改已取消的事件”

例如,如果我使用 API 删除重复系列中的事件,是否可以更改生成的重复异常的状态(没有 EXDATE,只有一个新的“已取消”事件仅当请求包含开始和结束日期的提要时才可见)以“确认”(甚至完全删除生成的异常)以便将重复系列恢复到原始状态?

一旦事件被取消, event.Delete() 和 event.Update() 甚至不再看到该事件。 event.Update() 给出上述错误。

谢谢!

I'm trying to change the status of an event back from "canceled" to "confirmed" using Google Calendar API (I'm using .NET but an answer in any language would help) but I get GDataRequestException error:

"You can't modify a cancelled event"

If I've used the API to delete an event in a repeating series, for example, is it possible to change the status of the resulting recurrence exception (there's no EXDATE, just a new "canceled" event that is only visible when the feed is requested with start and end date) to "confirmed" (or even delete the resulting exception completely) in order to restore the repeating series to the original state?

event.Delete() and event.Update() don't even see the event any longer once it's been .canceled. event.Update() gives the above error.

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

暖伴 2024-09-08 23:00:56

一旦事件设置为取消,似乎就无法更改事件的任何参数,包括状态“已取消”。我必须通过创建指定“原始事件”的新重复异常来解决该问题。

It seems like it's impossible to change any parameter for an event once it's set to cancelled, including the status "cancelled". I had to work around the issue by creating new recurrence exceptions with "Original Event" specified.

提笔落墨 2024-09-08 23:00:56

发现方法如下:首先通过调用/instances端点获取事件id(恰好是_格式):

https://www.googleapis.com/calendar/v3/calendars/primary/events/<masterEventId>/instances?showDeleted=true

然后调用< code>PATCH 并更改已取消事件的状态:

PATCH https://www.googleapis.com/calendar/v3/calendars/primary/events/<occurrenceId>

{
    "status": "confirmed"
}

Found the following way: first obtain the occurrence id (which happens to be in the <masterId>_<date> format) by calling /instances endpoint:

https://www.googleapis.com/calendar/v3/calendars/primary/events/<masterEventId>/instances?showDeleted=true

Then call PATCH and change the status of the cancelled occurrence:

PATCH https://www.googleapis.com/calendar/v3/calendars/primary/events/<occurrenceId>

{
    "status": "confirmed"
}
所谓喜欢 2024-09-08 23:00:56

我们还可以使用 get带参数eventId,我们需要在其中输入事件的id。我们得到了有关此事件的所有信息。我认为,在紧要关头,我们可以根据这些数据创建一个新事件。

We can also use get with parameter eventId, where we need to enter the id of the event. We get all the information about this event. I think that, in a pinch, we can create a new event based on this data.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文