Method: users.settings.sendAs.create
สร้างชื่อแทนการส่ง "จาก" ที่กำหนดเอง ถ้ามีการระบุ SMTP MSA ไว้ Gmail จะพยายามเชื่อมต่อกับบริการ SMTP เพื่อตรวจสอบการกำหนดค่าก่อนสร้างชื่อแทน หากต้องมีการยืนยันการเป็นเจ้าของสำหรับชื่อแทน ระบบจะส่งข้อความไปยังอีเมลและสถานะการยืนยันของทรัพยากรจะเป็น pending
มิฉะนั้น ระบบจะสร้างทรัพยากรขึ้นโดยมีสถานะการยืนยันเป็น accepted
หากมีลายเซ็น Gmail จะล้าง HTML ก่อนบันทึกด้วยชื่อแทน
วิธีนี้ใช้ได้เฉพาะกับลูกค้าบัญชีบริการที่ได้รับมอบอำนาจทั่วทั้งโดเมนเท่านั้น
คำขอ HTTP
POST https://gmail.googleapis.com/gmail/v1/users/{userId}/settings/sendAs
URL ใช้ไวยากรณ์การแปลง gRPC
พารามิเตอร์เส้นทาง
พารามิเตอร์ |
userId |
string
อีเมลของผู้ใช้ ค่าพิเศษ "me" สามารถใช้เพื่อระบุผู้ใช้ที่ตรวจสอบสิทธิ์แล้วได้
|
เนื้อหาของคำขอ
เนื้อความของคำขอมีอินสแตนซ์ของ SendAs
เนื้อหาการตอบกลับ
หากทำสำเร็จ เนื้อหาการตอบกลับจะมีอินสแตนซ์ SendAs
ที่สร้างขึ้นใหม่
ขอบเขตการให้สิทธิ์
ต้องใช้ขอบเขต OAuth ต่อไปนี้
https://www.googleapis.com/auth/gmail.settings.sharing
โปรดดูข้อมูลเพิ่มเติมที่คู่มือการให้สิทธิ์
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2024-09-05 UTC
[null,null,["อัปเดตล่าสุด 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"]]