短暂延迟后,API 状态会变为“已启用”。如果您没有看到 Android Device Provisioning Partner API,请检查贵组织是否已加入零触摸注册。请确保您在零触式注册和 Google API 控制台中使用的是同一 Google 账号。请咨询您的 Google 平台解决方案顾问,让对方检查您的 Google 账号是否有权访问该 API。
第 5 步:关联服务账号
将服务账号与贵组织的零触摸注册账号相关联,可授权该服务账号代表您的组织进行 API 调用。请按照以下步骤关联您的服务账号:
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-29。"],[[["\u003cp\u003eResellers must first join both the Samsung Knox Deployment Program (KDP) and Android zero-touch enrollment to use the Common Android Reseller Library.\u003c/p\u003e\n"],["\u003cp\u003eJoining KDP involves signing up on the Samsung Knox for Resellers website, creating a Samsung account, and retrieving the \u003ccode\u003eresellerId\u003c/code\u003e from the KDP portal, along with requesting access to the Knox Cloud API.\u003c/p\u003e\n"],["\u003cp\u003eZero-touch enrollment requires onboarding through the zero-touch enrollment program, requesting Reseller API access, and creating a Google service account through the Google API Console.\u003c/p\u003e\n"],["\u003cp\u003eThe service account created for zero-touch enrollment must be linked to the organization's zero-touch enrollment account to authorize API calls.\u003c/p\u003e\n"],["\u003cp\u003eThe Common Android Reseller Library can be added to a Gradle project by declaring the central Maven repository and adding a specific dependency to the \u003ccode\u003ebuild.gradle\u003c/code\u003e file.\u003c/p\u003e\n"]]],["Resellers must first join Samsung's Knox Deployment Program (KDP) and Android zero-touch enrollment. For KDP, they sign up, obtain a `resellerId`, request access to the Knox Cloud API Portal, and get service account keys and a `clientIdentifier`. For zero-touch, they onboard, request Reseller API access, create a service account in the Google API Console, generate a JSON key file, enable the Android Device Provisioning Partner API, and link the service account to their organization. Finally, they add the Common Android Reseller Library to their project.\n"],null,["Before using the Common Android Reseller Library, resellers need to join Samsung's\n[Knox Deployment Program](https://www.samsungknox.com/en/knox-deployment-program)\nand Android zero-touch enrollment.\n\nKnox Deployment Program (KDP)\n\nFollow the steps below to join [KDP](https://www.samsungknox.com/en/knox-deployment-program)\nand retrieve the necessary details to start using the reseller library.\n\nStep 1: sign up for KDP\n\n1. Visit [Samsung Knox for Resellers](https://www.samsungknox.com/en/for-resellers) to sign up for [KDP](https://www.samsungknox.com/en/knox-deployment-program).\n2. Create a Samsung account and register for a Samsung Knox account as reseller.\n3. After your reseller account is approved, login to the KDP portal to find your `resellerId`.\n\nStep 2: request access to the Knox Cloud API Portal\n\n1. Send a request to Samsung to get access to the Knox Cloud API Portal.\n2. Login to Knox Cloud API Portal.\n\nStep 3: get service account keys and `clientIdentifier`\n\n1. Download the key pair JSON file from the Knox Cloud API portal and store it in a safe place.\n2. Generate your unique `clientIdentifier` from the Knox Cloud API portal.\n\nStep 4: create the `SamsungResellerService` object\n\nUse the JSON file path, `clientIdentifier`, `resellerId` to create the\n`SamsungResellerService` object to use the common library.\n\nZero-touch enrollment\n\nStep 1: join the zero-touch enrollment program\n\n1. Onboard with [zero-touch enrollment](/zero-touch/guides/overview#reseller_onboarding).\n2. Because the Common Android Reseller Library uses the [Reseller API](/zero-touch/reference/reseller/rest), you need to request access to the Reseller API from your Google Platform Solutions Consultant.\n3. [Request access](/zero-touch/guides/portal#request_portal_access) to the zero-touch portal.\n\nWith the same Google Account you use to access the portal, follow the\nremaining instructions to create a service account and enable the Reseller API.\n\nStep 2: create a service account\n\nA service account, sometimes called a robot account, is a Google Account\nrepresenting apps instead of users. Because the enrollment library calls\nGoogle APIs on behalf of the service account, use the Google API Console to set\nup access.\n\nCreate an API Console project\n\nIt's good practice to create a new API Console project and service\naccount. This makes managing access, managing resources, and fixing lost keys\neasier in the future. Start by following the steps below to create a new project\nin Google API Console:\n\n1. Go to the [API Console](https://console.cloud.google.com/).\n2. From the projects list, select **[Create a project](https://console.cloud.google.com/projectcreate)**.\n3. Enter a name that describes your app and zero-touch enrollment.\n4. Specify a project ID or accept the default.\n5. Click **Create**.\n\nTo find out more, read the Google Cloud Platform document [Manage projects in\nthe console](https://support.google.com/cloud/answer/6158853).\n\nAdd new service credentials\n\nTo add new credentials and a service account to your project, follow the steps\nbelow in your API Console.\n\n1. Open the [**Service accounts** page](https://console.cloud.google.com/iam-admin/serviceaccounts). If prompted, select a project.\n2. Click add **Create Service Account** , enter a name and description for the service account. You can use the default service account ID, or choose a different, unique one. When done click **Create**.\n3. The **Service account permissions (optional)** section that follows is not required. Click **Continue**.\n4. On the **Grant users access to this service account** screen, scroll down to the **Create key** section. Click add **Create key**.\n5. In the side panel that appears, select the format for your key: **JSON** is recommended.\n6. Click **Create** . Your new public/private key pair is generated and downloaded to your machine; it serves as the only copy of this key. For information on how to store it securely, see [Managing service account keys](https://cloud.google.com/iam/docs/understanding-service-accounts#managing_service_account_keys).\n7. Click **Close** on the **Private key saved to your computer** dialog, then click **Done** to return to the table of your service accounts.\n\nCopy the email address of the service account and keep it handy. You need it\nlater when you link the service account to your organization.\n\nStep 3: store the JSON key file\n\nAPI Console generates a new private key pair used to authenticate\nAPI calls made using your service account. The private key is in the JSON key\nfile you download.\n\nYou should keep the key private, so don't include it in your software's source\ncode. If you lose the key file, you need to generate a new pair of keys.\n\nTo learn more about storing the key file securely, read [Best practices for\nsecurely using API keys](https://support.google.com/cloud/answer/6310037).\n\nStep 4: enable the API\n\nBefore the library can use the Reseller API, you need to enable it.\nEnabling an API associates it with the current API Console project\nand adds monitoring pages in your console.\n\nTo enable the Reseller API, follow the steps below in your API Console:\n\n1. Click **APIs \\& Services \\\u003e [Library](https://console.cloud.google.com/apis/library)**.\n2. Use the search field to find the [*Android Device Provisioning Partner API*](https://console.cloud.google.com/apis/library?q=Android%20Device%20Provisioning%20Partner%20API).\n3. Click *Android Device Provisioning Partner API*.\n4. Click **Enable**.\n\nAfter a short delay, the API status changes to enabled. If you don't see\n*Android Device Provisioning Partner API*, check that your organization's\nonboarded into zero-touch enrollment. Make sure you're using the same Google\nAccount for zero-touch enrollment and Google API Console. Ask your Google\nPlatform Solutions Consultant to check whether your Google Account has access to\nthe API.\n\nStep 5: link the service account\n\nLinking the service account with your organization's zero-touch enrollment\naccount authorizes the service account to make API calls on behalf of your\norganization. Follow the steps below to link your service account:\n\n1. Open the zero-touch enrollment [portal](https://enterprise.google.com/android/zero-touch/resellers). You might need to sign in.\n2. Click settings_ethernet **Service\n accounts**.\n3. Click add **Link service account**.\n4. Set **Email address** to the address of the service account you created.\n5. Click **Link service account** to use the service account with your zero-touch enrollment account.\n\nIf you can't find the email address of the service account you created, copy it\nfrom one of the following places:\n\n- A **Service account ID** from [**Service accounts** page](https://console.cloud.google.com/iam-admin/serviceaccounts) in the Google API Console.\n- The `client_email` property field in the JSON key file.\n\nYou can now use your service account with the enrollment library to [create\n`ResellerService` objects](/zero-touch/guides/reseller-library/common-operations#create_resellerservice_objects).\n\nAdd the Common Android Reseller Library to a Gradle project\n\nThe library is available as a [Maven repository](https://search.maven.org/artifact/com.github.kmeztapi/reseller-api/1.0.0/jar).\nFollow these steps to add the library to a new Gradle project:\n\n1. Run the following command to create a new project:\n\n gradle init --type basic\n mkdir -p src/main/java src/main/resources\n\n2. Copy the `service_account_key.json` file you downloaded in [Step 2](/zero-touch/guides/reseller-library/get-started#create-service)\n into the `src/main/resources/` directory you created above.\n\n3. Open the default `build.gradle` file and declare the central Maven repository\n for your build:\n\n repositories {\n mavenCentral()\n }\n\n4. In the same file, add the following dependency:\n\n dependencies {\n implementation 'com.github.kmeztapi:reseller-api:+'\n }\n\nYour project should now be able to use the client library to enroll Android\ndevices.\n\n*** ** * ** ***\n\n**Next steps:** [Common operations](/zero-touch/guides/reseller-library/common-operations)"]]