createCustomer
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
创建 Company
对象,以唯一标识 Knox 或零触摸注册的公司(客户)。该方法成功返回后,指定的所有者 (primary_emails
) 或管理员 (secondary_emails
) 可以将其电子邮件地址与 Google 账号相关联,以访问零接触客户门户(如需了解详情,请参阅面向 IT 管理员的零接触注册),或与三星账号相关联,以访问 Knox Mobile Enrollment (KME) 门户。
方法签名
public CreateCustomerResponse createCustomer(CreateCustomerRequest request) throws CommonException;
CreateCustomerRequest
属性名称 |
值 |
必填 |
说明 |
customer_name |
string |
是 |
公司的名称。例如 XYZ 公司。在零触摸注册门户中向该公司的员工显示。 |
primary_emails |
object(string) 的列表 |
是 |
零触摸:客户拥有 Owner 角色的用户的电子邮件地址。必须至少输入一个电子邮件地址。每个电子邮件地址都必须与 Google 账号相关联。所有者与管理员拥有相同的访问权限,但还可以添加、删除和修改贵组织的门户用户。
Samsung:客户的超级用户的电子邮件地址。Samsung 只会使用列表中的第一个电子邮件地址。电子邮件地址必须与 Samsung 账号相关联。 |
secondary_emails |
object(string) 的列表 |
否 |
具有管理员角色的客户用户的电子邮件地址。每个电子邮件地址都必须与 Google 账号相关联。注意:三星不支持此属性。 |
vendorParams |
map |
零触摸:否
三星:是 |
额外字段,供应商指定的键值对。SamsungResellerService 类中的请求必须指定:
“country”:客户的 ISO 3166-1 国家/地区代码,例如“US”。
“firstName”:客户的名字(最多 60 个字符)。
“lastName”:客户的姓氏(最多 60 个字符)。
“service”:仅支持值“KME”。 |
CreateCustomerResponse
属性名称 |
值 |
说明 |
customer |
object( Company ) |
包含新创建的客户的详细信息的对象。 |
vendor_params |
map |
额外字段,供应商指定的键值对(仅限三星)。 |
错误行为
如果发生错误,该库会抛出包含以下错误代码之一的 CommonException
:
CommonException
错误代码 |
INTERNAL_SERVER_ERROR |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-29。
[null,null,["最后更新时间 (UTC):2025-08-29。"],[[["\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` |"]]