สร้างลูกค้า
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
สร้างออบเจ็กต์ Company
เพื่อระบุบริษัท (ลูกค้า) ที่ไม่ซ้ำกันสำหรับการลงทะเบียน Knox หรือลงทะเบียนแบบรวมศูนย์ หลังจากวิธีการแสดงผลสําเร็จแล้ว เจ้าของ (primary_emails
) หรือผู้ดูแลระบบ (secondary_emails
) ที่ระบุจะเชื่อมโยงอีเมลกับบัญชี Google เพื่อเข้าถึงพอร์ทัลอุปกรณ์พร้อมใช้แบบรวมกลุ่มสําหรับลูกค้า (ดูรายละเอียดที่การลงทะเบียนการตั้งค่าอุปกรณ์พร้อมใช้แบบรวมกลุ่มสําหรับผู้ดูแลระบบไอที) หรือบัญชี Samsung เพื่อเข้าถึงพอร์ทัลการลงทะเบียนใช้งาน Knox Mobile (KME) ได้
ลายเซ็นเมธอด
public CreateCustomerResponse createCustomer(CreateCustomerRequest request) throws CommonException;
CreateCustomerRequest
ชื่อพร็อพเพอร์ตี้ |
ค่า |
ต้องระบุ |
คำอธิบาย |
customer_name |
string |
ใช่ |
ชื่อบริษัท เช่น XYZ Corp. ที่แสดงต่อพนักงานของบริษัทในพอร์ทัลการตั้งค่าอุปกรณ์พร้อมใช้แบบรวมกลุ่ม |
primary_emails |
รายการ object(string) |
ใช่ |
การตั้งค่าอุปกรณ์พร้อมใช้แบบรวมกลุ่ม: อีเมลของผู้ใช้ของลูกค้าในบทบาทเจ้าของ ต้องป้อนอีเมลอย่างน้อย 1 รายการ อีเมลแต่ละรายการต้องเชื่อมโยงกับบัญชี Google โดยเจ้าของจะมีสิทธิ์เข้าถึงระดับเดียวกันกับผู้ดูแลระบบ และสามารถเพิ่ม ลบ และแก้ไขผู้ใช้พอร์ทัลขององค์กรได้
Samsung: อีเมลของผู้ดูแลระบบขั้นสูงของลูกค้า Samsung จะใช้เฉพาะอีเมลแรกในรายการ อีเมลต้องเชื่อมโยงกับบัญชี Samsung |
secondary_emails |
รายการ object(string) |
ไม่ได้ |
อีเมลของผู้ใช้ของลูกค้าที่มีบทบาทผู้ดูแลระบบ อีเมลแต่ละรายการต้องเชื่อมโยงกับบัญชี Google หมายเหตุ: Samsung ไม่รองรับพร็อพเพอร์ตี้นี้ |
vendorParams |
map |
การตั้งค่าอุปกรณ์พร้อมใช้แบบรวมกลุ่ม: ไม่มี
Samsung: มี |
ฟิลด์เพิ่มเติม คู่คีย์-ค่าที่ระบุโดยผู้ให้บริการ คำขอจากคลาส SamsungResellerService ต้องระบุข้อมูลต่อไปนี้
"country": รหัสประเทศ ISO 3166-1 ของลูกค้า เช่น "US"
"firstName": ชื่อลูกค้า (สูงสุด 60 อักขระ)
"lastName": นามสกุลของลูกค้า (สูงสุด 60 อักขระ)
"service": "KME" เป็นค่าเดียวที่รองรับ |
CreateCustomerResponse
ชื่อพร็อพเพอร์ตี้ |
ค่า |
คำอธิบาย |
customer |
object( Company ) |
ออบเจ็กต์ที่มีรายละเอียดของลูกค้าที่สร้างขึ้นใหม่ |
vendor_params |
map |
ฟิลด์เพิ่มเติม คู่คีย์-ค่าที่ระบุโดยผู้ให้บริการ (Samsung เท่านั้น) |
ลักษณะการทำงานที่เกิดข้อผิดพลาด
หากเกิดข้อผิดพลาด ไลบรารีจะแสดง CommonException
ที่มีรหัสข้อผิดพลาดอย่างใดอย่างหนึ่งต่อไปนี้
CommonException
รหัสข้อผิดพลาด |
INTERNAL_SERVER_ERROR |
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-29 UTC
[null,null,["อัปเดตล่าสุด 2025-08-29 UTC"],[[["\u003cp\u003eThis process creates a \u003ccode\u003eCompany\u003c/code\u003e object to uniquely identify a customer for Knox or zero-touch enrollment.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ecustomer_name\u003c/code\u003e, \u003ccode\u003eprimary_emails\u003c/code\u003e, and \u003ccode\u003evendorParams\u003c/code\u003e are required parameters for creating a customer, and \u003ccode\u003esecondary_emails\u003c/code\u003e is optional.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eprimary_emails\u003c/code\u003e are email addresses for owners (for zero-touch) or super admins (for Samsung), who can access the zero-touch or Knox Mobile Enrollment portal, and must be associated with a Google Account or Samsung Account, respectively.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003esecondary_emails\u003c/code\u003e represent admin users for zero-touch enrollment, must be associated with a Google Account, and are not supported by Samsung.\u003c/p\u003e\n"],["\u003cp\u003eThe method throws a \u003ccode\u003eCommonException\u003c/code\u003e with an \u003ccode\u003eINTERNAL_SERVER_ERROR\u003c/code\u003e if an issue occurs during customer creation.\u003c/p\u003e\n"]]],["This document outlines how to create a `Company` object to identify a customer for Knox or zero-touch enrollment. The `createCustomer` method requires a company name and a list of primary email addresses (owners/super admins). Secondary email addresses (admins) are optional for zero-touch. Samsung requests also need `vendorParams`, specifying country, first name, last name, and \"KME\" service. Successful creation returns a `Company` object, allowing associated emails access to the zero-touch or KME portal. Errors result in a `CommonException`.\n"],null,["# createCustomer\n\nCreates a [`Company`](/zero-touch/reseller-library/reference/objects#company)\nobject to uniquely identify a company (customer) for Knox or zero-touch\nenrollment. After the method returns successfully, the specified owners (`primary_emails`)\nor admins (`secondary_emails`) can associate their email addresses with a Google\nAccount to access the [zero touch customer portal](https://enterprise.google.com/android/zero-touch/customers)\n(for details, see [Zero-touch enrollment for IT admins](https://support.google.com/work/android/answer/7514005))\nor a Samsung Account to access the Knox Mobile Enrollment (KME) portal.\n\nMethod signature\n----------------\n\n public CreateCustomerResponse createCustomer(CreateCustomerRequest request) throws CommonException;\n\nCreateCustomerRequest\n---------------------\n\n| Property name | Value | Required | Description |\n|--------------------|--------------------------|-------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `customer_name` | `string` | Yes | The name of the company. For example XYZ Corp. Displayed to the company's employees in the zero-touch enrollment portal. |\n| `primary_emails` | List of `object(string)` | Yes | **Zero-touch:** Email address of customer's users in the owner role. At least one email address is required. Each email address must be associated with a Google Account. Owners share the same access as admins but can also add, delete, and edit your organization's portal users. **Samsung:** Email address of customer's super admin. Samsung only takes the first email in the list. Email address must be associated with a Samsung Account. |\n| `secondary_emails` | List of `object(string)` | No | Email address of customer's users in the admin role. Each email address must be associated with a Google Account. **Note:** This property is not supported by Samsung. |\n| `vendorParams` | `map` | **Zero-touch:** No **Samsung:** Yes | Extra fields, vendor specified key-value pair. Requests from the `SamsungResellerService` class must specify: \"country\": [ISO 3166-1 country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the customer, for example \"US\". \"firstName\": first name of the customer (max. 60 characters). \"lastName\": last name of the customer (max. 60 characters). \"service\": \"KME\" is the only supported value. |\n\nCreateCustomerResponse\n----------------------\n\n| Property name | Value | Description |\n|-----------------|---------------------------------------------------------------------------------|---------------------------------------------------------------|\n| `customer` | `object(`[`Company`](/zero-touch/reseller-library/reference/objects#company)`)` | Object containing details of the newly created customer. |\n| `vendor_params` | `map` | Extra fields, vendor specified key-value pair (Samsung only). |\n\nError behavior\n--------------\n\nIf an error occurs, the library throws a `CommonException` containing one of the\nfollowing error codes:\n\n### `CommonException`\n\n| Error code |\n|-------------------------|\n| `INTERNAL_SERVER_ERROR` |"]]