Создает пользовательский псевдоним «Отправить как». Если указан SMTP MSA, Gmail попытается подключиться к службе SMTP, чтобы проверить конфигурацию перед созданием псевдонима. Если для псевдонима требуется подтверждение права собственности, на адрес электронной почты будет отправлено сообщение, а статус проверки ресурса будет установлен на pending ; в противном случае ресурс будет создан со статусом проверки accepted . Если указана подпись, Gmail очистит HTML-код перед сохранением его под псевдонимом.
Этот метод доступен только для клиентов учетной записи службы, которым были делегированы полномочия на уровне домена.
HTTP-запрос
POST https://gmail.googleapis.com/gmail/v1/users/{userId}/settings/sendAs
[[["Прост для понимания","easyToUnderstand","thumb-up"],["Помог мне решить мою проблему","solvedMyProblem","thumb-up"],["Другое","otherUp","thumb-up"]],[["Отсутствует нужная мне информация","missingTheInformationINeed","thumb-down"],["Слишком сложен/слишком много шагов","tooComplicatedTooManySteps","thumb-down"],["Устарел","outOfDate","thumb-down"],["Проблема с переводом текста","translationIssue","thumb-down"],["Проблемы образцов/кода","samplesCodeIssue","thumb-down"],["Другое","otherDown","thumb-down"]],["Последнее обновление: 2024-09-05 UTC."],[[["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"]]