Users: insert
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
สร้างผู้ใช้ที่จัดการโดย EMM ใหม่
ทรัพยากรของผู้ใช้
ที่ส่งมาในเนื้อหาของคำขอควรมี
accountIdentifier
และ accountType
หากมีผู้ใช้ที่ตรงกันซึ่งมีตัวระบุบัญชีเดียวกันอยู่แล้ว
ผู้ใช้จะได้รับการอัปเดตด้วยทรัพยากร ในกรณีนี้ จะมีเพียงฟังก์ชัน
เปลี่ยนช่อง displayName
ได้
ส่งคำขอ
คำขอ HTTP
POST https://www.googleapis.com/androidenterprise/v1/enterprises/enterpriseId/users
พารามิเตอร์
ชื่อพารามิเตอร์ |
ค่า |
คำอธิบาย |
พารามิเตอร์เส้นทาง |
enterpriseId |
string |
รหัสขององค์กร
|
การให้สิทธิ์
คำขอนี้ต้องได้รับการให้สิทธิ์ตามขอบเขตต่อไปนี้
ขอบเขต |
https://www.googleapis.com/auth/androidenterprise |
สำหรับข้อมูลเพิ่มเติม โปรดดูที่หน้าการตรวจสอบสิทธิ์และการให้สิทธิ์
เนื้อหาของคำขอ
ในเนื้อหาคำขอ ให้ระบุทรัพยากรผู้ใช้โดยมีพร็อพเพอร์ตี้ต่อไปนี้
ชื่อพร็อพเพอร์ตี้ |
ค่า |
คำอธิบาย |
หมายเหตุ |
พร็อพเพอร์ตี้ที่จำเป็น |
accountIdentifier |
string |
ตัวระบุที่ไม่ซ้ำกันซึ่งคุณสร้างให้ผู้ใช้รายนี้ เช่น "user342" หรือ "asset#44418" อย่าใช้ข้อมูลส่วนบุคคลที่ระบุตัวบุคคลนั้นได้ (PII) สำหรับพร็อพเพอร์ตี้นี้ ต้องตั้งค่าสำหรับผู้ใช้ที่จัดการโดย EMM เสมอ ไม่ได้ตั้งค่าให้กับผู้ใช้ที่จัดการโดย Google |
|
accountType |
string |
ประเภทของบัญชีที่ผู้ใช้รายนี้เป็นตัวแทน userAccount สามารถติดตั้งได้ในอุปกรณ์หลายเครื่อง แต่ deviceAccount จะใช้กับอุปกรณ์เครื่องเดียวโดยเฉพาะ ผู้ใช้ที่จัดการโดย EMM (emmManaged ) อาจเป็นประเภทใดก็ได้ (userAccount , deviceAccount ) แต่ผู้ใช้ที่จัดการโดย Google (googleManaged ) จะเป็น userAccount เสมอ
ค่าที่ยอมรับได้ มีดังนี้
- "
deviceAccount "
- "
userAccount "
|
|
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 UTC"],[[["\u003cp\u003eCreates or updates an EMM-managed user within a specified enterprise.\u003c/p\u003e\n"],["\u003cp\u003eRequires an \u003ccode\u003eaccountIdentifier\u003c/code\u003e and \u003ccode\u003eaccountType\u003c/code\u003e to define the user.\u003c/p\u003e\n"],["\u003cp\u003eUses a POST request to the \u003ccode\u003e/enterprises/enterpriseId/users\u003c/code\u003e endpoint.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003edisplayName\u003c/code\u003e is the only field that can be updated for existing users.\u003c/p\u003e\n"],["\u003cp\u003eAuthorization with the \u003ccode\u003ehttps://www.googleapis.com/auth/androidenterprise\u003c/code\u003e scope is necessary.\u003c/p\u003e\n"]]],[],null,["# Users: insert\n\n| **Note:** Requires [authorization](#auth).\n\nCreates a new EMM-managed user.\n\n\u003cbr /\u003e\n\n\nThe [Users](/android/work/play/emm-api/v1/users) resource\npassed in the body of the request should include an\n`accountIdentifier` and an `accountType`.\n\nIf a corresponding user already exists with the same account identifier,\nthe user will be updated with the resource. In this case only the\n`displayName` field can be changed.\n\n\u003cbr /\u003e\n\nRequest\n-------\n\n### HTTP request\n\n```\nPOST https://www.googleapis.com/androidenterprise/v1/enterprises/enterpriseId/users\n```\n\n### Parameters\n\n| Parameter name | Value | Description |\n|----------------|----------|---------------------------|\n| **Path parameters** |||\n| `enterpriseId` | `string` | The ID of the enterprise. |\n\n### Authorization\n\nThis request requires authorization with the following scope:\n\n| Scope |\n|-----------------------------------------------------|\n| `https://www.googleapis.com/auth/androidenterprise` |\n\nFor more information, see the [authentication and authorization](/android/work/play/emm-api/v1/how-tos/authorizing) page.\n\n### Request body\n\nIn the request body, supply a [Users resource](/android/work/play/emm-api/v1/users#resource) with the following properties:\n\n| Property name | Value | Description | Notes |\n|---------------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------|\n| **Required Properties** ||||\n| `accountIdentifier` | `string` | A unique identifier you create for this user, such as \"user342\" or \"asset#44418\". Do not use personally identifiable information (PII) for this property. Must always be set for EMM-managed users. Not set for Google-managed users. | |\n| `accountType` | `string` | The type of account that this user represents. A `userAccount` can be installed on multiple devices, but a `deviceAccount` is specific to a single device. An EMM-managed user (`emmManaged`) can be either type (`userAccount`, `deviceAccount`), but a Google-managed user (`googleManaged`) is always a `userAccount`. \u003cbr /\u003e Acceptable values are: - \"`deviceAccount`\" - \"`userAccount`\" | |\n\nResponse\n--------\n\nIf successful, this method returns a [Users resource](/android/work/play/emm-api/v1/users#resource) in the response body."]]