The APIs explorer allows you to call Android Management API directly. To call the API from a server, you need to enable Android Management API for your project and create a service account.
Enable the Android Management API
Enable the Android Management API for your project.
Sign in to the Google API Console.
Select or create a project.
Click Enable API.
Search for and select Android Management API in the API library.
Click Enable.
Create your service account
Sign in to the Google API Console.
Open the Credentials page. If prompted, select the project that has the Android Management API enabled.
Click Create credentials > Service account key.
From the dropdown menu, select New service account. Enter a name for your service account.
Select your preferred key type and click Create. Your new public/private key pair is generated and downloaded to your machine and is the only copy of this key. You are responsible for storing it securely.
Open the IAM page. If prompted, select the project that has the Android Management API enabled.
Click Add.
Add the service account you've just created as member and select the role Android Management User.
Click Save.
(Optional, but highly recommended) Add additional project owners by granting the Owner role to existing project members.
Roles and permissions
To access the Android Management API your service account requires the
androidmanagement.enterprises.manage
permission, which can be granted by the
Android Management User role (or roles/androidmanagement.user
).