如何获得消息标记,例如“已看到"在Gmail API中 [英] How to get message flags like "seen" in Gmail API

查看:54
本文介绍了如何获得消息标记,例如“已看到"在Gmail API中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用RESTful API从Gmail中获取电子邮件,但看不到如何获得邮件标志(已读/未读等). 是否可以使用RESTful API从Gmail获取邮件标志?

I'm trying to get email messages from Gmail using the RESTful API and I don't see how can I get message flags (read / unread and etc.). Is there any way to get message flags from the Gmail using the RESTful API?

谢谢.

推荐答案

标志"和文件夹"是什么意思?您是否习惯使用IMAP并以这种方式引用它?通常,您需要查看的标签是"UNREAD".这些标签是硬编码的系统标签,并记录在以下位置: https://developers.google.com/gmail/api/guides/labels

What do you mean by "flags" and "folders"? are you used to using IMAP and referring to it in that sense? what you normally would want is to look at labels like "UNREAD". those labels are the hardcoded, system labels and are documented at: https://developers.google.com/gmail/api/guides/labels

它们是那些确切的值,从未翻译为其他语言,例如网络 user 界面.

they are those exact values, never translated to other languages like the web user interface is.

gmail没有仅包含标签的标志"或文件夹".提供了标志和文件夹概念(有点怪异)来支持IMAP.如果要在收件箱中查看所有未读邮件,请执行以下操作:

gmail doesn't have "flags" or "folders" just labels. the flags and folder concepts are (somewhat hackily) provided to support IMAP. if you want to see all the unread message in the inbox just do something like:

>>> messages.list(labelIds=["INBOX", "UNREAD'])

这篇关于如何获得消息标记,例如“已看到"在Gmail API中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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