Gmail API の概要
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
Gmail API は、Gmail メールボックスにアクセスしてメールを送信するために使用できる RESTful API です。ほとんどのウェブ アプリケーションでは、ユーザーの Gmail データへの承認済みアクセスに Gmail API を使用するのが最適です。Gmail API は、次のようなさまざまなアプリケーションに適しています。
- メールの読み取り専用抽出、インデックス登録、バックアップ
- 自動またはプログラムによるメッセージの送信
- メールアカウントの移行
- メールの整理(メッセージのフィルタリングや並べ替えなど)
- 組織全体でメールの署名を標準化する
Gmail API で使用される一般的な用語を以下に示します。
- メッセージ
- 送信者、受信者、件名、本文を含むメール メッセージ。メッセージを作成した後は、メッセージを変更できません。メッセージはメッセージ リソースで表されます。
- スレッド
- 会話を形成する関連メッセージのコレクション。メール クライアント アプリでは、1 人以上の受信者がメッセージに返信すると、スレッドが形成されます。
- ラベル
メッセージとスレッドを整理するためのメカニズム。たとえば、「税金」というラベルを作成して、ユーザーの税金に関連するすべてのメッセージとスレッドに適用できます。ラベルには次の 2 つの種類があります。
- システムラベル
- 内部で作成されたラベル(
INBOX
、TRASH
、SPAM
など)。これらのラベルは削除または変更できません。ただし、INBOX
などの一部のシステムラベルは、メールやスレッドに適用したり、メールやスレッドから削除したりできます。 - ユーザーラベル
- ユーザーが作成したラベル。これらのラベルは、ユーザーまたはアプリケーションによって削除または変更できます。ユーザーラベルは、ラベルリソースで表されます。
- Draft
未送信のメッセージ。下書きに含まれるメッセージは置き換えることができます。下書きを送信すると、下書きが自動的に削除され、SENT
システムラベルが付いたメールが作成されます。下書きは、下書きリソースで表されます。
次のステップ
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-08-29 UTC。
[null,null,["最終更新日 2025-08-29 UTC。"],[],[],null,["# Gmail API Overview\n\nThe Gmail API is a RESTful API that can be used to access Gmail mailboxes and\nsend mail. For most web applications the Gmail API is the best choice for\nauthorized access to a user's Gmail data and is suitable for various\napplications, such as:\n\n- Read-only mail extraction, indexing, and backup\n- Automated or programmatic message sending\n- Email account migration\n- Email organization including filtering and sorting of messages\n- Standardization of email signatures across an organization\n\nFollowing is a list of common terms used in the Gmail API:\n\n*Message*\n: An email message containing the sender, recipients, subject, and body. After a\n message has been created, a message cannot be changed. A message is represented\n by a [message resource](/workspace/gmail/api/reference/rest/v1/users.messages#Message).\n\n*Thread*\n: A collection of related messages forming a conversation. In an email client\n app, a thread is formed when one or more recipients respond to a message with\n their own message.\n\n*Label*\n\n: A mechanism for organizing messages and threads. For example,\n the label \"taxes\" might be created and applied to all messages and threads\n having to do with a user's taxes. There are two types of labels:\n\n *System labels*\n : Internally-created labels, such as `INBOX`, `TRASH`, or `SPAM`. These labels\n cannot be deleted or modified. However, some system labels, such as `INBOX`\n can be applied to, or removed from, messages and threads.\n\n *User labels*\n : Labels created by a user. These labels can be deleted or modified by the\n user or an application. A user label is represented by a\n [label resource](/workspace/gmail/api/reference/rest/v1/users.labels).\n\n*Draft*\n\n: An unsent message. A message contained within the draft can be replaced.\n Sending a draft automatically deletes the draft and creates a message with\n the `SENT` system label. A draft is represented by a\n [draft resource](/workspace/gmail/api/reference/rest/v1/users.drafts).\n\nNext steps\n----------\n\n- To learn about developing with Google Workspace APIs, including handling\n authentication and authorization, refer\n to [Get started as a Google Workspace developer](/workspace/guides/getstarted-overview).\n\n- To learn how to configure and run a simple Gmail API app, read the\n [Quickstarts overview](/workspace/gmail/api/guides/quickstarts-overview)."]]