How to get unread mails from primary inbox in Gmail?

前端 未结 3 1842
失恋的感觉
失恋的感觉 2021-01-22 06:57

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 lab

相关标签:
3条回答
  • 2021-01-22 07:11

    You could try "in:unread category:primary "

    0 讨论(0)
  • 2021-01-22 07:17

    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
    }
    
    0 讨论(0)
  • 2021-01-22 07:19

    Try also this "in:inbox is:unread category:primary"

    0 讨论(0)
提交回复
热议问题