使用 Samsung 和 Google 工廠類別來建立 ResellerService
物件。
透過 ResellerService
物件,常見的一組方法可用於要求及註冊 Samsung 和其他 Android 裝置。
SamsungResellerServiceFactory
您必須先使用 KDP 加入,才能使用 SamsungResellerServiceFactory
類別產生 ResellerService
物件。以下是使用 SamsungResellerServiceFactory
類別建立 ResellerService
物件的方法簽章:
public static ResellerService createResellerService(String resellerId, String serviceAccountKeyFilePath, String clientIdentifier) throws CommonException;
輸入參數
資源名稱 | 值 | 必填 | 說明 |
---|---|---|---|
resellerId |
string |
相容 | 由 KDP 系統提供的經銷商專屬 ID。 |
serviceAccountKeyFilePath |
string |
相容 | 服務帳戶金鑰的檔案路徑。 |
clientIdentifier |
string |
相容 | KDP 系統提供的用戶端 ID。 |
錯誤行為
如果發生錯誤,程式庫會擲回包含以下其中一個錯誤代碼的 CommonException
:
錯誤代碼 |
---|
INVALID_RESELLER_ID |
AUTHORIZATION_FAIL |
GoogleResellerServiceFactory
如要使用 GoogleResellerServiceFactory
類別產生 ResellerService
物件,您必須先以經銷商的身分加入零接觸註冊機制。
以下示範如何使用 GoogleResellerServiceFactory
類別建立 ResellerService
物件的方法簽章:
public static ResellerService createResellerService(long resellerId, String serviceAccountKeyFilePath) throws CommonException, InterruptedException;
輸入參數
資源名稱 | 值 | 必填 | 說明 |
---|---|---|---|
resellerId |
long |
相容 | 經銷商的專屬識別碼,由零接觸系統提供。 |
serviceAccountKeyFilePath |
string |
相容 | 服務帳戶金鑰的檔案路徑。 |
錯誤行為
如果發生錯誤,程式庫會擲回包含以下其中一個錯誤代碼的 CommonException
:
錯誤代碼 |
---|
INVALID_PARAM_DEFAULT |
INVALID_RESELLER_ID |
INTERNAL_SERVER_ERROR |