Gmail API 概览
Gmail API 是一种 RESTful API,可用于访问 Gmail 邮箱和发送邮件。对于大多数 Web 应用,如需获得对用户 Gmail 数据的授权访问权限,Gmail API 是最佳选择,适用于各种应用,例如:
- 只读邮件提取、索引编制和备份
- 自动或程序化消息发送
- 电子邮件账号迁移
- 电子邮件整理,包括邮件的过滤和排序
- 在整个组织中统一电子邮件签名
以下是 Gmail API 中常用的术语列表:
- 短信
- 包含发件人、收件人、主题和正文的电子邮件。消息一经创建便无法更改。消息由消息资源表示。
- 线程
- 一组相关消息,构成对话。在电子邮件客户端应用中,当一位或多位收件人用自己的邮件回复某封邮件时,系统会形成会话。
- 标签
用于整理消息和会话的机制。例如,您可以创建“税费”标签,并将其应用于与用户税费相关的所有邮件和会话。标签分为以下两种类型:
- 系统标签
- 内部创建的标签,例如
INBOX
、TRASH
或 SPAM
。这些标签无法删除或修改。不过,某些系统标签(例如 INBOX
)可以应用于邮件和会话,也可以从中移除。
- 用户标签
- 用户创建的标签。用户或应用可以删除或修改这些标签。用户标签由标签资源表示。
- 草稿
未发送的消息。草稿中包含的消息可以替换。发送草稿会自动删除草稿,并创建带有 SENT
系统标签的邮件。草稿由草稿资源表示。
后续步骤
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-12-21。
[null,null,["最后更新时间 (UTC):2024-12-21。"],[[["The Gmail API is a RESTful API used to access Gmail mailboxes and send mail, suitable for tasks like reading, sending, and organizing emails."],["The API is not intended as a full email client replacement but is ideal for web applications needing authorized access to user data."],["Key terms include: Messages (individual emails), Threads (related messages), Labels (for organization), and Drafts (unsent messages)."],["Developers can find resources on authentication, authorization, and quickstart guides to begin using the Gmail API."]]],["The Gmail API, a RESTful API, enables authorized access to Gmail data for tasks like reading, indexing, backing up, sending, migrating, filtering, and standardizing email. It uses *messages*, *threads*, and *labels* (system or user-created) to organize emails. *Drafts* are unsent messages that, when sent, become messages. The API shouldn't replace IMAP for full email clients. To start using this API, users need to refer to the Get started as a Google Workspace developer guide and the quickstart overview.\n"]]