Method: users.insert
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
สร้างผู้ใช้
การเรียกใช้การกลายพันธุ์ทันทีหลังจากสร้างผู้ใช้อาจไม่สำเร็จในบางครั้งเนื่องจากระบบยังไม่ได้สร้างผู้ใช้อย่างสมบูรณ์เนื่องจากความล่าช้าในการนำไปใช้งานในแบ็กเอนด์ ตรวจสอบรายละเอียดข้อผิดพลาดสำหรับข้อความ "การสร้างผู้ใช้ไม่เสร็จสมบูรณ์" เพื่อดูว่าปัญหานี้เกิดขึ้นหรือไม่ ในกรณีนี้ การโทรอีกครั้งหลังจากผ่านไประยะหนึ่งอาจช่วยได้
หากตั้งค่า resolveConflictAccount
เป็น true
รหัสการตอบกลับ 202
หมายความว่ามีบัญชีที่ไม่มีการจัดการที่ทับซ้อนกันอยู่และได้รับเชิญให้เข้าร่วมองค์กร รหัสการตอบกลับ 409
หมายความว่ามีบัญชีที่ทับซ้อนกันอยู่ ระบบจึงไม่สร้างผู้ใช้ตามตัวเลือกการจัดการบัญชีผู้ใช้ที่ไม่มีการจัดการที่เลือกไว้
คำขอ HTTP
POST https://admin.googleapis.com/admin/directory/v1/users
URL ใช้ไวยากรณ์การแปลง gRPC
พารามิเตอร์การค้นหา
พารามิเตอร์ |
resolveConflictAccount |
boolean
ไม่บังคับ หากตั้งค่าเป็น true ระบบจะใช้ตัวเลือกที่เลือกไว้สำหรับการจัดการบัญชีผู้ใช้ที่ไม่มีการจัดการ ค่าเริ่มต้น: false
|
เนื้อหาของคำขอ
เนื้อความของคำขอมีอินสแตนซ์ของ User
เนื้อหาการตอบกลับ
หากทำสำเร็จ เนื้อหาการตอบกลับจะมีอินสแตนซ์ User
ที่สร้างขึ้นใหม่
ขอบเขตการให้สิทธิ์
ต้องใช้ขอบเขต OAuth ต่อไปนี้
https://www.googleapis.com/auth/admin.directory.user
ดูข้อมูลเพิ่มเติมได้ที่คู่มือการให้สิทธิ์
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[null,null,["อัปเดตล่าสุด 2025-07-25 UTC"],[],[],null,["# Method: users.insert\n\nCreates a user.\n\nMutate calls immediately following user creation might sometimes fail as the user isn't fully created due to propagation delay in our backends. Check the error details for the \"User creation is not complete\" message to see if this is the case. Retrying the calls after some time can help in this case.\n\nIf `resolveConflictAccount` is set to `true`, a `202` response code means that a conflicting unmanaged account exists and was invited to join the organization. A `409` response code means that a conflicting account exists so the user wasn't created based on the [handling unmanaged user accounts](https://support.google.com/a/answer/11112794) option selected.\n\n### HTTP request\n\n`POST https://admin.googleapis.com/admin/directory/v1/users`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Query parameters\n\n| Parameters ||\n|--------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `resolveConflictAccount` | `boolean` Optional. If set to `true`, the option selected for [handling unmanaged user accounts](https://support.google.com/a/answer/11112794) will apply. Default: `false` |\n\n### Request body\n\nThe request body contains an instance of [User](/workspace/admin/directory/reference/rest/v1/users#User).\n\n### Response body\n\nIf successful, the response body contains a newly created instance of [User](/workspace/admin/directory/reference/rest/v1/users#User).\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/admin.directory.user`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]