Google 活动 API:活动已更新,未发送电子邮件通知
Google Event API: Event updated, email notification not sent
我想使用 Python 中的请求库通过 API 更新 Google 事件。
当我发送补丁请求时,事件被更新,但没有发送通知,尽管我按照指定设置了参数in the documentation。
我的代码:
payload = {
# ...
}
headers = {
# ...
}
params = {"sendUpdates": "all"}
request_url = f"https://www.googleapis.com/calendar/v3/calendars/primary/events/{google_event_id}"
response = requests.patch(
url=request_url, headers=headers, json=payload, params=params
)
我也尝试过使用已弃用的参数 sendNotifications
,我尝试将参数放入负载中,手动将它们写入 url 参数,但它仍然不起作用。
我错过了什么吗?
在检查 "Try this" 部分后,我意识到只有在某些关键字段被修改时才会发送电子邮件通知(例如 summary
或 attendees
)。我正在尝试仅更新 description
不发送通知。
我上面的代码片段适用于更新关键字段。
我想使用 Python 中的请求库通过 API 更新 Google 事件。
当我发送补丁请求时,事件被更新,但没有发送通知,尽管我按照指定设置了参数in the documentation。
我的代码:
payload = {
# ...
}
headers = {
# ...
}
params = {"sendUpdates": "all"}
request_url = f"https://www.googleapis.com/calendar/v3/calendars/primary/events/{google_event_id}"
response = requests.patch(
url=request_url, headers=headers, json=payload, params=params
)
我也尝试过使用已弃用的参数 sendNotifications
,我尝试将参数放入负载中,手动将它们写入 url 参数,但它仍然不起作用。
我错过了什么吗?
在检查 "Try this" 部分后,我意识到只有在某些关键字段被修改时才会发送电子邮件通知(例如 summary
或 attendees
)。我正在尝试仅更新 description
不发送通知。
我上面的代码片段适用于更新关键字段。