如何从Gmail的主收件箱中获取未读邮件? [英] How to get unread mails from primary inbox in Gmail?

查看:575
本文介绍了如何从Gmail的主收件箱中获取未读邮件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Javascript客户端API与我的应用程序,并试图从主收件箱中获取未读邮件。



如果我在请求标签时使用INBOX和UNREAD名称,我会从所有标签中获取所有未读邮件。



没有其他标签类型名称的作品,我已经在API Explorer中进行了实验,我似乎无法弄清楚如何管理它。



我错过了什么或者是这不可能?

您可以试试这个 in:收件箱是:未读-category:(promotions or social)作为消息中q参数的值。名单。我在API浏览器中试过这个,并且给出了正确的结果。



我的收件箱中有4个UNREAD邮件(或线程),响应是:



200 OK

  {
messages:[
$ bid:14aea080215aa680,---线程1
threadId:14aea080215aa680
},
{
id: 14ae8e25e92657e3,---线程2
threadId:14ae8e25e92657e3
},
{
id:14ae5e7a8bb1bc2f, - 线程3
threadId:14ae433c5ae8de64
},
{
id:14ae439fd8cd3726, - 具有不同消息ID的同一线程3
threadId:14ae433c5ae8de64
},
{
id:14ae433c5ae8de64, - 具有不同消息ID的同一线程3
threadId:14ae433c5ae8de64
},
{
id:14ae33d8431a06f3, - 线程4
threadId:14ae33d8431a06f3
}
],
resultSizeEstimate :6
}


I'm using the Javascript client API with my app and I'm trying to get unread mails from the primary inbox.

If I use the INBOX and UNREAD names when requesting the labels I get all unread mails from all labels.

No other label type name works, I've experimented in APIs explorer and i can't seem to figure out how to manage this.

Am I missing something or is it not possible?

解决方案

You can try this "in:inbox is:unread -category:(promotions OR social)" as a value for q parameter in messages.list. I tried this in API explorer, and it gave correct results.

I have 4 "UNREAD" mails(or Threads) in my inbox, and response is:

200 OK

{
 "messages": [
  {
   "id": "14aea080215aa680", --- Thread 1
   "threadId": "14aea080215aa680"
 },
 {
  "id": "14ae8e25e92657e3", --- Thread 2
   "threadId": "14ae8e25e92657e3"
  },
 {
  "id": "14ae5e7a8bb1bc2f",-- Thread 3
  "threadId": "14ae433c5ae8de64"
 },
{
  "id": "14ae439fd8cd3726",-- Same thread 3 with different message id
  "threadId": "14ae433c5ae8de64"
 },
{
  "id": "14ae433c5ae8de64",-- Same thread 3 with different message id
  "threadId": "14ae433c5ae8de64"
 },
{
  "id": "14ae33d8431a06f3",-- Thread 4
  "threadId": "14ae33d8431a06f3"
}
],
  "resultSizeEstimate": 6
}

这篇关于如何从Gmail的主收件箱中获取未读邮件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆