Method: users.messages.insert
مستقیماً یک پیام را فقط در صندوق پستی این کاربر مانند IMAP APPEND
وارد میکند و اکثر اسکنها و طبقهبندیها را دور میزند. پیام نمیده.
درخواست HTTP
- URI آپلود، برای درخواست های آپلود رسانه:
POST https://gmail.googleapis.com/upload/gmail/v1/users/{userId}/messages
- URI فراداده، برای درخواستهای فقط فراداده:
POST https://gmail.googleapis.com/gmail/v1/users/{userId}/messages
URL از دستور GRPC Transcoding استفاده می کند.
پارامترهای مسیر
مولفه های |
---|
userId | string آدرس ایمیل کاربر. مقدار ویژه me می تواند برای نشان دادن کاربر تأیید شده استفاده شود. |
پارامترهای پرس و جو
مولفه های |
---|
internalDateSource | enum ( InternalDateSource ) منبع تاریخ داخلی پیام جیمیل. |
deleted | boolean ایمیل را بهعنوان حذفشده دائمی (نه TRASH) علامتگذاری کنید و فقط در Google Vault برای سرپرست Vault قابل مشاهده باشد. فقط برای حسابهای Google Workspace استفاده میشود. |
درخواست بدن
بدنه درخواست شامل یک نمونه از Message
است.
بدن پاسخگو
در صورت موفقیت آمیز بودن، بدنه پاسخ حاوی نمونه ای از Message
است.
محدوده مجوز
به یکی از حوزه های OAuth زیر نیاز دارد:
-
https://mail.google.com/
-
https://www.googleapis.com/auth/gmail.modify
-
https://www.googleapis.com/auth/gmail.insert
برای اطلاعات بیشتر، به راهنمای مجوز مراجعه کنید.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2024-10-30 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2024-10-30 بهوقت ساعت هماهنگ جهانی."],[[["Directly inserts a message into the user's mailbox, similar to `IMAP APPEND`, bypassing most scanning and classification."],["Supports two types of requests: uploading media content (`POST /upload/...`) and sending metadata only (`POST /...`)."],["Requires providing the user's email address (`userId`) as a path parameter and offers optional query parameters to control internal date source and deletion behavior."],["The request and response bodies both utilize the `Message` resource for structuring email data."],["To authorize, you'll need one of the specified OAuth scopes related to Gmail access and modification."]]],["This content outlines the process for directly inserting a message into a user's Gmail mailbox. Key actions include using `POST` requests to either an upload URI (`/upload/gmail/v1/users/{userId}/messages`) or a metadata URI (`/gmail/v1/users/{userId}/messages`). The `userId` path parameter identifies the user, and query parameters like `internalDateSource` and `deleted` provide further message properties. A `Message` instance is sent in the request and returned in the response. Authentication requires specific OAuth scopes.\n"]]