编辑 Google 日历 "From" 和 "Organizer"
Edit Google Calendar "From" and "Organizer"
我想使用 Go 通过 google 日历 api 创建活动。我发现发件人(发件人)是我在 google API 中提供的 client_id 中的负责人,在这种情况下是我。我能否编辑此发件人,使其不再由我发送?至少我可以编辑发件人的显示名称,我认为的电子邮件将永远是我的电子邮件
关于编辑组织者,我尝试使用移动操作,但它只会移动事件,不会改变组织者。还有其他编辑管理器的方法吗?
解决您的问题:
1.我可以从另一个地址创建活动吗?
您可以通过创建服务帐户并执行 domain-wide-delegation
来完成您想要的
什么是服务帐号?
服务帐户是一种特殊类型的 Google 帐户,旨在代表 non-human 用户,该用户需要进行身份验证并被授权访问 Google API 中的数据s - 在你的情况下日历 API.
创建上述服务帐户后,您必须执行 domain-wide-delegation 并模拟您域中的用户才能创建所需的活动。
现在,在为您的应用程序编写代码时,您将使用为此帐户创建的凭据来授权请求。
或
如果您只想专门编辑活动创建者的显示名称,您可以执行更新请求:
PUT https://www.googleapis.com/calendar/v3/calendars/calendarId/events/eventId
并在请求正文中添加:
"creator": {
"displayName": "UPDATED DISPLAY NAME"
}
2。我可以编辑组织者吗?
根据 Calendar API Documentation:
organizer
> The organizer of the event. If the organizer is also an attendee, this is indicated with a separate entry in attendees with the organizer field set to True. To change the organizer, use the move operation. Read-only, except when importing an event.
因此,组织者可以changed/updated 只有在导入事件时才会有问题。
参考
我想使用 Go 通过 google 日历 api 创建活动。我发现发件人(发件人)是我在 google API 中提供的 client_id 中的负责人,在这种情况下是我。我能否编辑此发件人,使其不再由我发送?至少我可以编辑发件人的显示名称,我认为的电子邮件将永远是我的电子邮件
关于编辑组织者,我尝试使用移动操作,但它只会移动事件,不会改变组织者。还有其他编辑管理器的方法吗?
解决您的问题:
1.我可以从另一个地址创建活动吗?
您可以通过创建服务帐户并执行 domain-wide-delegation
来完成您想要的什么是服务帐号?
服务帐户是一种特殊类型的 Google 帐户,旨在代表 non-human 用户,该用户需要进行身份验证并被授权访问 Google API 中的数据s - 在你的情况下日历 API.
创建上述服务帐户后,您必须执行 domain-wide-delegation 并模拟您域中的用户才能创建所需的活动。
现在,在为您的应用程序编写代码时,您将使用为此帐户创建的凭据来授权请求。
或
如果您只想专门编辑活动创建者的显示名称,您可以执行更新请求:
PUT https://www.googleapis.com/calendar/v3/calendars/calendarId/events/eventId
并在请求正文中添加:
"creator": {
"displayName": "UPDATED DISPLAY NAME"
}
2。我可以编辑组织者吗?
根据 Calendar API Documentation:
organizer
> The organizer of the event. If the organizer is also an attendee, this is indicated with a separate entry in attendees with the organizer field set to True. To change the organizer, use the move operation. Read-only, except when importing an event.
因此,组织者可以changed/updated 只有在导入事件时才会有问题。