在 GmailAPI 中,如何检索收件箱中的新邮件

In GmailAPI, how to retrieve messages that are new in the Inbox

我正在使用 列出未读消息 = GmailApi.ListMessages(myGmailService, "me", "in:unread"); 按照 google 的示例,但这会带来 1000 条消息,包括已存档的消息,收件箱中不再有

如何将我的条件限制为收件箱?

您可以更改查询以仅列出具有 INBOX 标签且未读的邮件。

List unreadMsgs = GmailApi.ListMessages(myGmailService, "me", "in:inbox AND is:unread");