[英]how to get read and unread message list using gmail api javascript
How to get difference read and unread from mail list's using Gamil api javascript.i have used gmail api v1 javascript, but it's display overall rows list. 如何使用Gamil api javascript.i从邮件列表中获取读取和未读的差异已使用gmail api v1 javascript,但它显示整个行列表。
Thanks, 谢谢,
When listing messages , you can give a custom search query in the q
query parameter. 列出邮件时 ,您可以在
q
查询参数中提供自定义搜索查询。 Just set the value to is:unread
to get unread messages, or !is:unread
to get read messages: 只需将值设置
is:unread
以获取未读消息,或者!is:unread
以获取读取消息:
Request 请求
GET https://www.googleapis.com/gmail/v1/users/me/messages?q=is%3Aunread&access_token={YOUR_ACCESS_TOKEN}
Response 响应
{
"messages": [
{
"id": "1565ad3af8dbd82e",
"threadId": "1565ad3af8dbd82e"
}
],
"resultSizeEstimate": 1
}
Its worked for me: https://www.googleapis.com/gmail/v1/users/ {yourgmailid}/messages?q=is:unread 它对我有用: https : //www.googleapis.com/gmail/v1/users/ {yourgmailid} / messages?q = is:unread
In headers:- Content-Type: application/json Authorization: Bearer Accept : application/json 在标题中: - Content-Type:application / json授权:Bearer Accept:application / json
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.