סקירה כללית על הממשק של Gmail API
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
Gmail API הוא RESTful API שאפשר להשתמש בו כדי לגשת לתיבות דואר ב-Gmail ולשלוח אימייל. ברוב אפליקציות האינטרנט, Gmail API היא הבחירה הטובה ביותר לגישה מורשית לנתונים של משתמש ב-Gmail, והיא מתאימה למגוון אפליקציות, כמו:
- קריאה בלבד של חילוץ, יצירת אינדקס וגיבוי של אימיילים
- שליחת הודעות אוטומטית או באמצעות תוכנה
- העברת חשבונות אימייל
- סידור האימיילים, כולל סינון ומיון של ההודעות
- סטנדרטיזציה של חתימות אימייל בארגון
בהמשך מופיעה רשימה של מונחים נפוצים שמשמשים ב-Gmail API:
- Message
- הודעת אימייל שמכילה את השולח, הנמענים, הנושא והתוכן. אחרי שיוצרים הודעה, אי אפשר לשנות אותה. הודעה מיוצגת על ידי משאב הודעה.
- Thread
- אוסף של הודעות קשורות שיוצרות שיחה. באפליקציית לקוח אימייל, שרשור נוצר כשנמען אחד או יותר משיבים להודעה עם הודעה משלהם.
- הוספת תווית
מנגנון לארגון הודעות ושרשורים. לדוגמה, אפשר ליצור את התווית 'מיסים' ולהחיל אותה על כל ההודעות והשרשורים שקשורים למיסים של המשתמש. יש שני סוגים של תוויות:
- תוויות מערכת
- תוויות שנוצרו באופן פנימי, כמו
INBOX
, TRASH
או SPAM
. אי אפשר למחוק או לשנות את התוויות האלה. עם זאת, אפשר להוסיף או להסיר חלק מתוויות המערכת, כמו INBOX
, מהודעות ומשרשורים.
- תוויות משתמש
- תוויות שנוצרו על ידי משתמש. המשתמש או אפליקציה יכולים למחוק או לשנות את התוויות האלה. תווית משתמש מיוצגת על ידי משאב תווית.
- Draft
הודעה שלא נשלחה. אפשר להחליף הודעה שנכללת בטיוטה.
שליחת טיוטה מוחקת אותה באופן אוטומטי ויוצרת הודעה עם תווית המערכת SENT
. טיוטה מיוצגת על ידי משאב טיוטה.
השלבים הבאים
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 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)."]]