開始使用

注意:您無需將開發人員帳戶與 Google Cloud 控制台建立連結,即可存取 Google Play Developer Reporting API。

您必須先為 Google Play 開發人員帳戶設定 API 存取權,才能開始進行 API 呼叫。這包含 Google Play 管理中心和 Google Cloud 控制台中的變更。以下操作說明說明開始使用 Google Play Developer Reporting API 所需的四個步驟:

  1. 建立 Google Cloud 專案。
  2. 為 Google Cloud 專案啟用 Google Play Developer Reporting API。
  3. 為 Google Cloud 專案中的 Google Play Developer Reporting API 授權 API 金鑰。
  4. 設定具備適當 Google Play 管理中心權限的服務帳戶,以便存取 Google Play Developer Reporting API。

建立 Google Cloud 專案

如果您已有要使用的 Google Cloud 專案,可以略過這個步驟。

必須設定 Google Cloud 專案,才能使用 Google Play Developer Reporting API。您可以前往 Google Cloud 控制台進行這項操作。

如要進一步瞭解 Google Cloud 專案,請參閱「建立及管理專案」。

啟用 API

如何啟用 Google Play Developer Reporting API:

  1. 前往 Google Cloud 控制台的 Google Play Developer Reporting API 頁面
  2. 按一下「啟用」。

授權 API 金鑰

如要使用這個 API,您的 Google Cloud 專案中需有 API 金鑰,且該金鑰有權使用 Google Play Developer Reporting API。請在 Google Cloud 控制台中進行設定。

設定服務帳戶

服務帳戶必須在安全環境 (例如您的伺服器) 中使用。服務帳戶憑證必須採用安全的管理方式,因此任何未獲授權使用 API 的人都能得知這些憑證。

建立服務帳戶

如要建立新的服務帳戶,請按照下列指示操作:

  1. 在 Google Cloud Console 中,前往「Service Accounts」(服務帳戶) 頁面
  2. 按一下「建立服務帳戶」,然後按照步驟操作。

授予權限

如要允許任何服務帳戶存取您應用程式的 Google Play 管理中心資料,您必須授予權限。

  1. 前往 Google Play 管理中心的使用者和權限頁面
  2. 按一下「邀請新的使用者」
  3. 請在電子郵件地址欄位中填入服務帳戶的電子郵件地址,並授予執行操作的必要權限。建議您只向服務帳戶授予呼叫所需 API 動作所需的最低權限組合。
  4. 按一下「邀請使用者」按鈕。

完成這些步驟後,您就可以使用適當的 API 金鑰,透過服務帳戶存取 Google Play Developer Reporting API。

參考資料

如要查詢特殊資源類型或方法,請參閱參考資料