I'm trying to get a list of all mobile devices from G Suite Admin in a python script using guide. But in response, I only get a list of devices owned by users, not the company. I marked the device's return in green on the screenshot. screen
Previously, I created a project in Google Cloud, connected the admin SDK API to it, and created a service account. For the account I enabled data access delegation in the G Suite domain, which created an oauth 2.0 client ID for me. Also in G Suite in the security settings I added access for this account to scope https://www.googleapis.com/auth/admin.directory.device.mobile.
I don 't use the google library. Using it, I couldn 't bypass the proxy server.
I use the library Requests to access the server. Here is an approximate algorithm of my actions:
- I create a JWT using the library jwt. I use the "sub" parameter to specify an account in Google admin. The account I use has administrator rights.
- Using JWT I get a google access token.
- Using the access token I get a list of devices according to the instructions https://developers.google.com/admin-sdk/directory/v1/reference/mobiledevices/list.
But I don't get all the necessary devices. How can I get devices that are owned by an organization?