相关疑难解决方法(0)

在新的Gmail API中批量处理电子邮件

我正在使用Google新发布的Gmail API的python版本.

以下调用仅返回消息ID列表:

service.users().messages().list(userId = 'me').execute()
Run Code Online (Sandbox Code Playgroud)

但后来我只有一个消息ID列表,需要迭代它们并逐个获取它们.

有没有办法在单个调用中获取id列表的整个消息内容?(类似于在Google Calendar API中完成的操作)?

如果还不支持,Google会考虑在API中添加这些内容吗?

更新

这是适合我的解决方案:
batch = BatchHttpRequest() for msg_id in message_ids: batch.add(service.users().messages().get(userId = 'me', id = msg_id['id']), callback = mycallbackfunc) batch.execute()

python google-api gmail-api

24
推荐指数
2
解决办法
4462
查看次数

标签 统计

gmail-api ×1

google-api ×1

python ×1