サービス アカウントを作成する
API Explorer を使用すると、Android Management API を直接呼び出すことができます。サーバーから API を呼び出すには、プロジェクトで Android Management API を有効にして、サービス アカウントを作成する必要があります。
Android Management API を有効にする
プロジェクトで Android Management API を有効にします。
Google API Console にログインします。
プロジェクトを選択または作成します。
プロジェクト ページに移動
[API を有効にする] をクリックします。
API ライブラリで [Android Management API] を検索して選択します。
[API ライブラリ] ページに移動
[有効にする] をクリックします。
サービス アカウントを作成する
Google API Console にログインします。
[認証情報] ページを開きます。プロンプトが表示されたら、Android Management API が有効になっているプロジェクトを選択します。
[認証情報の作成] > [サービス アカウント キー] をクリックします。
プルダウン メニューから [新しいサービス アカウント] を選択します。サービス アカウントの名前を入力します。
使用するキーのタイプを選択し、[作成] をクリックします。新しい公開鍵と秘密鍵のペアが生成され、パソコンにダウンロードされます。この鍵は唯一のコピーです。これはお客様の責任で安全に保管する必要があります。
[IAM] ページを開きます。プロンプトが表示されたら、Android Management API が有効になっているプロジェクトを選択します。
[追加] をクリックします。
作成したサービス アカウントをメンバーとして追加し、ロール [Android Management User] を選択します。
[保存] をクリックします。
(省略可、ただし強く推奨)既存のプロジェクト メンバーにオーナーのロールを付与して、プロジェクト オーナーを追加します。
ロールと権限
Android Management API にアクセスするには、サービス アカウントに androidmanagement.enterprises.manage
権限が必要です。この権限は、Android Management User ロール(または roles/androidmanagement.user
)で付与できます。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2023-12-02 UTC。
[null,null,["最終更新日 2023-12-02 UTC。"],[[["Use the APIs Explorer to directly interact with the Android Management API."],["To call the API from a server, enable the Android Management API for your Google Cloud project and create a service account with the \"Android Management User\" role."],["Securely store the generated public/private key pair for your service account as it is the only copy and crucial for API access."],["Optionally, enhance project security by granting the \"Owner\" role to existing project members for additional oversight."]]],["To use the Android Management API, first enable it in the Google API Console by selecting your project and enabling it. Then, create a service account by generating a new key pair. Next, assign the \"Android Management User\" role to the service account in the IAM page. The service account needs the `androidmanagement.enterprises.manage` permission, granted by the role. Optionally, add project owners with the Owner role.\n"]]