User.threads.list不返回所有线程

时间:2015-02-18 12:09:40

标签: gmail-api

我试图为我的测试用户获取所有线程 根据用户个人资料(Users.getProfile)," threadsT​​otal" = 45771

所以,我希望为Users.threads.list获得45771个帖子 但是,我只获得了599个结果。

我在请求中使用了以下参数:

:fields => "threads(id),nextPageToken",
:includeSpamTrash => true, 
:userId => "me", 
:maxResults => '100'

在日志中,我看到6个成功的api电话。(100 + 100 + 100 + 100 + 100 + 99个结果)

使用:maxResults => ' 20'我只得到319个结果。(有16个成功的api通话)

我如何为我的用户获取所有线程?

1 个答案:

答案 0 :(得分:0)

It looks like this might be related to the number of threads in the trash and the spam folder. I found the discrepancy between the threadsTotal value in the response to users.get_profile and threads.list.count to be equal to the number of threads in the trash.

I also checked users.get_profile.messageCount and messages.list.count and found a similar result.

This problem disappears for me when I set :includeSpamTrash to be false in the users.threads.list parameters.