Skip to main content
New Member
June 11, 2024
Question

Can I use androiddeviceprovisioning.googleapis.com as a customer ?

  • June 11, 2024
  • 2 replies
  • 12 views

Hello,

 

I have access to https://partner.android.com/zerotouch (or to the nice new portal 🙂) to manage which configuration I want to send to our devices. The account I use is "owner". I have created a project with Partner API in Google Cloud.

 

For now I try to query my device list with androiddeviceprovisioning.googleapis.com using OAuth 2.0 Playground with that URI : https://androiddeviceprovisioning.googleapis.com/v1/partners/my_company_ID/devices/*

But all I succeed is to have an access denied :

{
 
"error": {
   
"status": "PERMISSION_DENIED",
   
"message": "Request had insufficient authentication scopes.",
   
"code": 403,
   
"details": [
     
{
       
"reason": "ACCESS_TOKEN_SCOPE_INSUFFICIENT",
       
"@type": "type.googleapis.com/google.rpc.ErrorInfo",
       
"domain": "googleapis.com",
       
"metadata": {
         
"method": "google.android.device.provisioning.v1.DeviceProvisioningPartnerService.GetDevice",
         
"service": "androiddeviceprovisioning.googleapis.com"
       
}
     
}
   
]
 
}
}

 What am I missing ? Is that only possible for a customer (and not a resseller) to access devices with API ?

Thanks for you help.
Pierre from France

2 replies

jasonbayton
Level: 4.1: Jelly bean
June 12, 2024

Hey! 

 

Check out the resource: 

 

 
There is no list in the resource for partners, but there are other queries you might be able to do to get what you're looking for?
New Member
June 12, 2024

I've made some progress \o/
Thanks to your link, I found the "Customer" section of the API documentation (I'm not very used to browse Google API Documentation 😅) :
https://developers.google.com/zero-touch/reference/customer/rest

Using that documentation, I successfully executed a query in C# with the provided code here :
https://developers.google.com/zero-touch/guides/customer/quickstart/dotnet

Afterwards, I attempted to modify the code to list my devices (instead of DPCs). However, despite repeated attempts, I failed to do so until I finally discovered that I needed to limit the results by providing a query parameter "pageSize" or a "nextPageToken" if the result exceeds a limit (which appears to be 100 devices).

I am more confortable with Powershell, so I attempted to achieve the same task in PowerShell. I successfully executed a query of my configurations with this URI:
https://androiddeviceprovisioning.googleapis.com/v1/customers/mucustomerID/devices?pageSize=100

Now I need to code a search tool to find a device in the list and a function to apply one of our MDM configurations to a device. However, now that I have the underlying logic, it should be easier. The concept of "nextPageToken" still remains mysterious for now. I need to investigate how to query all my devices and not just 100 of them. I will share my findings here once I have more time to investigate further.

Have a nice day,
Pierre from France