ภาพรวมของ Gmail API
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
Gmail API คือ RESTful API ที่ใช้เข้าถึงกล่องจดหมาย Gmail และส่งอีเมลได้ สำหรับเว็บแอปพลิเคชันส่วนใหญ่ Gmail API เป็นตัวเลือกที่ดีที่สุดสำหรับ
การเข้าถึงข้อมูล Gmail ของผู้ใช้ที่ได้รับอนุญาต และเหมาะสำหรับแอปพลิเคชันต่างๆ
เช่น
- การดึงข้อมูล การจัดทำดัชนี และการสำรองข้อมูลอีเมลแบบอ่านอย่างเดียว
- การส่งข้อความอัตโนมัติหรือแบบเป็นโปรแกรม
- การย้ายข้อมูลบัญชีอีเมล
- การจัดระเบียบอีเมล รวมถึงการกรองและการจัดเรียงข้อความ
- การกำหนดลายเซ็นอีเมลให้เป็นมาตรฐานทั่วทั้งองค์กร
ต่อไปนี้คือรายการคำศัพท์ทั่วไปที่ใช้ใน Gmail API
- ข้อความ
- ข้อความอีเมลที่มีผู้ส่ง ผู้รับ เรื่อง และเนื้อหา หลังจากสร้างข้อความแล้ว คุณจะเปลี่ยนแปลงข้อความไม่ได้ ข้อความจะแสดงด้วยทรัพยากรข้อความ
- ชุดข้อความ
- ชุดข้อความที่เกี่ยวข้องซึ่งประกอบกันเป็นบทสนทนา ในแอปไคลเอ็นต์อีเมล
ชุดข้อความจะเกิดขึ้นเมื่อผู้รับอย่างน้อย 1 คนตอบกลับข้อความพร้อม
ข้อความของตนเอง
- ป้ายกำกับ
กลไกในการจัดระเบียบข้อความและชุดข้อความ เช่น
อาจสร้างป้ายกำกับ "ภาษี" และนำไปใช้กับข้อความและเธรดทั้งหมด
ที่เกี่ยวข้องกับภาษีของผู้ใช้ ซึ่งมีป้ายกำกับอยู่สองประเภทดังนี้
- ป้ายกำกับของระบบ
- ป้ายกำกับที่สร้างขึ้นภายใน เช่น
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)."]]