Can I use androiddeviceprovisioning.googleapis.com as a customer ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2024 09:15 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2024 05:02 AM
Hey!
Check out the resource:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2024 08:55 AM - edited 06-12-2024 09:00 AM
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
- IMEI number cant be added, but customer can see that number in their ZTP in General discussions
- Samsung devices getting stuck during enrolment when using zero-touch or QR in Germany in General discussions
- Ability to add devices in ZTE console as Customer in General discussions
- [Community survey] Android Enterprise training / certification in General discussions
- Error when customer tries to deploy from private google play store through MDM in General discussions