Google Calendar补丁API似乎只编辑与会者的事件,而不是其他所有人。

huangapple go评论48阅读模式
英文:

Google Calendar patch API only seems to edit the event for the attendee and not everyone else

问题

Google Calendar API 允许您通过提供 calendarIdeventId 和要有选择性更新的属性的请求正文来进行事件的部分更新。

我有这样的情况:

  • Alice 创建了一个事件(假设事件 ID 为 event123)并邀请了 Bob。这使 Alice 成为组织者。
  • Bob 收到了邀请,这使他成为参与者。

Alice 和 Bob 都分别使用 API 进行了身份验证,我们称之为 Alice 的身份验证(A)和 Bob 的身份验证(B)。

(A) 和 (B) 似乎都看到了具有相同事件 ID event123 的相同事件。但是,当 (A) 对 event123 进行补丁时,事件会对所有人都进行更改。然而,当 (B) 对 event123 进行补丁时,只会对 Bob 进行更改。

这让我感到惊讶,也让 API 几乎没有用处。是否有一种方式可以让 (B) 更新事件,以便它对所有人都进行更新?假设他们对事件具有编辑访问权限?

Google Calendar UI 的行为似乎是我要寻找的,所以我有点困惑为什么 API 不会默认行为像那样。

英文:

The Google Calendar API lets you patch events by having you provide calendarId, eventId and a request body of the properties you want to selectively update.

I have a situation where I have:

  • Alice creates and event (let's say with id event123) and invites Bob. This makes Alice the organizer
  • Bob receives the invite, this makes him an attendee

Alice and Bob both separately auth with the API, let's call Alice's auth (A) and Bob's (B)

(A) and (B) both seem to see the same event with the same event id event123. When (A) does a patch on event123, the event changes for everyone. However, when (B) does a patch on event123, it only changes for Bob.

This is surprising to me, and makes the API almost useless. Is there some way for (B) to update the event so that it updates for everyone? Assuming they have edit access on the event?

The behavior on Google Calendar's UI seems to be what I'm looking for, so I'm a little bit confused why the API doesn't behave like that by default.

答案1

得分: 1

我在我的一端进行了一些测试,得到了相同的结果,即使嘉宾已启用“修改事件”权限,更改仅在嘉宾事件中反映出来。

目前看来,这似乎是预期行为,因为即使具有正确权限,作为嘉宾通过日历API修改事件的能力尚不可用,您可以在此处查看功能请求(https://issuetracker.google.com/204791550)。

嘉宾可以通过日历API直接修改组织者日历中的事件,但这意味着“组织者”需要与特定用户共享其日历,并授予其更改事件的权限。如果这对您是一个选项,在组织者与特定嘉宾分享日历后,嘉宾将需要在“patch”请求中指定组织者的“calendarId”。

参考资料:

英文:

I did some testing on my end and I got the same result, even if the guests have the Modify event permission enabled, changes are only reflected in the guest event.

At this moment this seems to be expected behavior as this ability to modify events as a guest even with the right permissions is not yet available through the Calendar API, you can check the feature request here.

The guest could modify the event in the organizer's calendar directly through the Calendar API but this means that the organizer would need to share their calendar with the specific user and give permissions to make changes to events. If this is an option for you, after the organizer shares the calendar with the specific guest, then the guest will need to specify the organizer's calendarId in the patch request.

References:

huangapple
  • 本文由 发表于 2023年6月9日 02:48:53
  • 转载请务必保留本文链接:https://go.coder-hub.com/76434882.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定