gmail - Google Gmail API 订阅为每封新邮件或已发送电子邮件发布两个 Webhook 响应
问题描述
- 调用 watch() 并订阅收件箱
watch_request = Google::Apis::GmailV1::WatchRequest.new
watch_request.topic_name = GMAIL_SUBSCRIPTION_TOPIC_NAME
watch_response = gmail_client.service.watch_user(google_user_id, watch_request)
- 将测试电子邮件发送到该收件箱或从该收件箱
- 通过 webhook 接收两个不同的推送通知,每个通知的历史 ID 略有不同。第二条消息在第一条消息之后几秒钟到达。
gmail 帐户似乎是标准的。我想知道这是否是预期的。我开始认为这是因为labelFilterAction
和labelIds
被忽略,并且多个标签与收件箱中的新未读电子邮件相匹配UNREAD
和INBOX
。最近在 2019 年 2 月的其他 StackOverflow 问题中记录了它。
https://developers.google.com/gmail/api/v1/reference/users/watch
解决方案
推荐阅读
- python - The first and the last date that a variable appear in my dataframe
- excel - 如果日期较旧,如何制作删除行的代码
- python - How to build regex for finding words that start with `\n` and letter and end with digit OR word?
- asp-classic - 如何通过域而不是 IP 限制经典 asp 页面访问?
- elasticsearch - 如何将默认 GKE 堆栈驱动程序日志记录更改为 fluentd
- windows - Win32 API 与 Windows Api Set (WIn10),Windows Api 是否为完整的 win32api 设置了 DLL 包装器?
- docker - 用户 'user=bn_moodle'@'localhost' 的访问被拒绝(使用密码:否)
- google-apps-script - 收到表单回复后,Google 表格脚本通过电子邮件发送
- python-3.x - 如何使用 tf.saved_model API 在 tf.data.Dataset() 中恢复悬空的 tf.py_func?
- json - 如何在 Elasticsearch 中按两个子句过滤数据?