0
votes

I got the super admin privileges for to my Google Account.

I need to get the list of all the chrome devices through an API.

I did enable Google Admin SDK but still facing some issues. I copied the exact python script from Python Quickstart for checking but still getting error as

"googleapiclient.errors.HttpError: https://www.googleapis.com/admin/directory/v1/users?customer=my_customer&orderBy=email&alt=json&maxResults=10 returned "Insufficient Permission">"

When checked on Admin SDK API dashboard I can see 4xx errors for every call made from my python script.

2

2 Answers

0
votes

When you run the sample you need to make sure that this step

The sample will attempt to open a new window or tab in your default browser. If this fails, copy the URL from the console and manually open it in your browser. If you are not already logged into your Google account, you will be prompted to log in. If you are logged into multiple Google accounts, you will be asked to select one account to use for the authorization.

Is done from the Google account which has access to your admin account. The user you are logged in with now does not have access.

0
votes

I managed to get Super Admin access of Google account and then grant access to my project for different scopes. The docs/ references are so confusing hence it took a while for me to figure it out. So under the admin console, we have to get into Security >> Advanced Settings >> Manage API Client Access(under Authentication) and then add the client name and the scopes(multiple scopes separated by commas) for which we need access. Client name is the client-id which we can get from the client-secretxxxxx.json file(downloaded while creating the oauth id). NOTE :- You do NOT need super admin access it is just that I was new and the guy who gave me the initial access wasn't sure what has to be enabled across. Also couldn't post as a comment due to the limitation of characters.