【发布时间】:2019-01-27 09:59:59
【问题描述】:
当我查询 Gmail API 时
results = service.users().messages().list(userId='me',q="from:xyz@wso2.com", maxResults=10).execute()
我得到了这个输出。这里我没有收到所有消息它只返回了Thread Id 和id
"messages": [
{
"id": "1655b9b497dc76aa",
"threadId": "165380da74833127"
},
{
"id": "1655b9a7409383dd",
"threadId": "1655b9a7409383dd"
},
{
"id": "1655b9a25c441268",
"threadId": "16470b77316be7ab"
},
{....
为了得到消息,我必须再次查询。这里的问题是,当我使用 Id 查询时,它返回 400 错误,但是当我使用线程时,它返回带有 sn-p 的消息。但是在documentation中,他们已经明确提到我们要给出id
id - string - The ID of the message to retrieve.
- Thread Id 和 Id 有什么区别?
- 我不能查询所有字段吗-
“labelIds”:[ “未读”, "CATEGORY_FORUMS", “收件箱” ], “sn-p”:“嗨,Amanda、Ruwan 和 Mifan,我们已经完成了与 Verizon 的 RFP 回合!请您查看 RFP 并开始 在做这个吗?如果我们需要让 WSO2 电信公司参与进来,请告诉我。 谢谢,”, "historyId": "5217959", “内部日期”:“1534833021000”....
作为一个没有查询的JSON,一次又一次,使用每个ID?如果我查询那么多时间,因为我必须查询 150000 个 ID,Google API 似乎可能会阻止我使用节流机制。
【问题讨论】:
标签: python google-api gmail gmail-api google-api-python-client