如何使用Gmail API获取INBOX中的未读线程数?

问题描述:

我尝试使用列表线程方法:

I tried to use the list thread method:

GET https://www.googleapis.com/gmail/v1/users/{MyEmailAddress}/threads?labelIds=INBOX&labelIds=UNREAD&key={YOUR_API_KEY}

resultSizeEstimate与Gmail网络应用程序中我的收件箱旁边的数字不匹配.

The resultSizeEstimate does not match the number next to my inbox in Gmail web app.

还有另一种方法吗?

现在,Gmail API使用Labels.Get()方法为每个Label上的邮件和线程提供了总计和未读计数.看: https://developers.google.com/gmail/api/release-notes https://developers.google.com/gmail/api/v1/reference /users/labels

The Gmail API now provides total and unread counts for messages and threads on each Label using the Labels.Get() method. See: https://developers.google.com/gmail/api/release-notes and https://developers.google.com/gmail/api/v1/reference/users/labels