0

I am working on a program to help with Chromebook management. Using Java my goal is to create a program that will allow me to easily de-provision and change OU on multiple Chromebooks at once.

I have been writing some code using the Google Admin SDK and so far am able to connect with my directory and authenticate the API. The issue I am having is that I am struggling to get a workable list of the Chromebook devices. I have looked through the javadoc many times and found several data types and methods that will help my situation. Unfortunately, in practice I cannot seem to find a way to use these functions.

One method is on the Chromeosdevices data type and is getChromeosdevices() which returns a list of all the chromeOS devices in Java List format. However I cannot find where to call this method.

I need to be able to compare serial numbers on the Chrome devices but so far I have not been able to get access to them.

I appreciate any help anyone may be able to provide. If I need to provide more information just let me know.

  • This is the method: https://developers.google.com/admin-sdk/directory/v1/reference/chromeosdevices/list. And the corresponding documentation for Java: https://developers.google.com/resources/api-libraries/documentation/admin/directory_v1/java/latest/com/google/api/services/admin/directory/model/ChromeOsDevices.html – ziganotschka Apr 15 '20 at 07:46

1 Answers1

0

Since your connection was successful with the directory api i am assuming you have Bearer token.

Using that token you could use the chromeos list API https://developers.google.com/admin-sdk/directory/v1/reference/chromeosdevices/list to retrieve/update the devices. This is how i used in my project.

https://www.googleapis.com/admin/directory/v1/customer/yourcustomerid/devices/chromeos?projection=FULL/BASIC&query=location:

Also you could get the device based on any listed properties.

  • Also i had the Resource Authorization issue. This is how i solved it. https://stackoverflow.com/questions/61279055/google-adminsdk-directory-api-access not sure this will helps in your scenario – Kannan Seenivasagam Apr 19 '20 at 21:22