نمای کلی Gmail API
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
Gmail API یک API RESTful است که میتوان از آن برای دسترسی به صندوقهای پستی Gmail و ارسال نامه استفاده کرد. برای اکثر برنامه های کاربردی وب، Gmail API بهترین انتخاب برای دسترسی مجاز به داده های Gmail کاربر است و برای برنامه های مختلف مانند:
- استخراج، نمایه سازی و پشتیبان گیری نامه فقط خواندنی
- ارسال خودکار یا برنامه ای پیام
- انتقال حساب ایمیل
- سازماندهی ایمیل از جمله فیلتر کردن و مرتبسازی پیامها
- استانداردسازی امضاهای ایمیل در سراسر یک سازمان
در زیر لیستی از اصطلاحات رایج مورد استفاده در Gmail API آمده است:
- پیام
- یک پیام ایمیل حاوی فرستنده، گیرندگان، موضوع و متن. پس از ایجاد یک پیام، پیام را نمی توان تغییر داد. یک پیام توسط یک منبع پیام نمایش داده می شود.
- موضوع
- مجموعه ای از پیام های مرتبط که یک مکالمه را تشکیل می دهد. در یک برنامه سرویس گیرنده ایمیل، زمانی که یک یا چند گیرنده با پیام خود به یک پیام پاسخ می دهند، یک موضوع تشکیل می شود.
- برچسب بزنید
مکانیزمی برای سازماندهی پیام ها و موضوعات. به عنوان مثال، برچسب "مالیات" ممکن است ایجاد شود و برای همه پیامها و موضوعات مرتبط با مالیات کاربر اعمال شود. دو نوع برچسب وجود دارد:
- برچسب های سیستم
- برچسبهای ایجاد شده داخلی، مانند
INBOX
، TRASH
، یا SPAM
. این برچسب ها را نمی توان حذف یا تغییر داد. با این حال، برخی از برچسبهای سیستم، مانند INBOX
را میتوان روی پیامها و رشتهها اعمال کرد یا از آنها حذف کرد. - برچسب های کاربر
- برچسب های ایجاد شده توسط یک کاربر این برچسب ها را می توان توسط کاربر یا یک برنامه حذف یا تغییر داد. یک برچسب کاربر توسط یک منبع برچسب نشان داده می شود.
- پیش نویس
یک پیام ارسال نشده پیام موجود در پیش نویس را می توان جایگزین کرد. ارسال پیش نویس به طور خودکار پیش نویس را حذف می کند و پیامی با برچسب سیستم SENT
ایجاد می کند. یک پیش نویس با یک منبع پیش نویس نشان داده می شود.
مراحل بعدی
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی."],[],[],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)."]]