Method: users.settings.sendAs.create
یک نام مستعار send-as سفارشی "از" ایجاد می کند. اگر یک SMTP MSA مشخص شده باشد، Gmail سعی می کند قبل از ایجاد نام مستعار، به سرویس SMTP متصل شود تا پیکربندی را تأیید کند. اگر تأیید مالکیت برای نام مستعار مورد نیاز باشد، پیامی به آدرس ایمیل ارسال میشود و وضعیت تأیید منبع روی pending
تنظیم میشود. در غیر این صورت، منبع با وضعیت تأیید ایجاد شده روی accepted
ایجاد می شود. اگر امضا ارائه شود، Gmail HTML را قبل از اینکه با نام مستعار ذخیره کند، پاکسازی میکند.
این روش فقط برای سرویس گیرندگان حساب خدماتی در دسترس است که اختیارات گسترده دامنه به آنها واگذار شده است.
درخواست HTTP
POST https://gmail.googleapis.com/gmail/v1/users/{userId}/settings/sendAs
URL از دستور GRPC Transcoding استفاده می کند.
پارامترهای مسیر
مولفه های |
---|
userId | string آدرس ایمیل کاربر. مقدار ویژه "me" را می توان برای نشان دادن کاربر تأیید شده استفاده کرد. |
درخواست بدن
بدنه درخواست شامل یک نمونه از SendAs
است.
بدن پاسخگو
در صورت موفقیت آمیز بودن، بدنه پاسخ حاوی یک نمونه جدید از SendAs
است.
محدوده مجوز
به محدوده OAuth زیر نیاز دارد:
-
https://www.googleapis.com/auth/gmail.settings.sharing
برای اطلاعات بیشتر، به راهنمای مجوز مراجعه کنید.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2024-09-05 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2024-09-05 بهوقت ساعت هماهنگ جهانی."],[[["Creates a custom \"from\" send-as alias, requiring validation for SMTP MSAs and potentially ownership verification."],["Accessible only to service account clients with delegated domain-wide authority, using a specific HTTP POST request."],["Utilizes path parameters including `userId` to identify the user's email address, and requires a request body with a `SendAs` instance."],["Returns a `SendAs` instance in the response body upon successful alias creation."],["Needs authorization with the `https://www.googleapis.com/auth/gmail.settings.sharing` scope."]]],["This describes how to create a custom \"from\" send-as alias in Gmail using a `POST` request to the specified URL. The request includes a `userId` path parameter. The request body contains `SendAs` information, and the response will also be a `SendAs` instance. The creation process may involve SMTP validation and alias verification, setting the resource's verification status accordingly. It also sanitizes provided HTML signatures. This method is limited to service account clients with delegated domain-wide authority and requires a specific OAuth scope.\n"]]