google-admin-sdk

Get list of users with name, phone number and group memberships from G Suite

雨燕双飞 提交于 2019-12-12 05:28:29
问题 I have looked into the G Suite admin APIs and found this function: GET https://www.googleapis.com/admin/directory/v1/users I get a list of all users, but no users in the list have a phone number. How can I include the user's phone number in the list? I would also like to know how to get a list of every user's group memberships if this is possible. 回答1: The phone number property is under user Resource which you might have missed since it's also located in the Users.list under Response. { "kind

Google API Client users().get(userKey='name@domain.com') returns Not Authorized to access this resource/api

末鹿安然 提交于 2019-12-12 05:03:24
问题 I'm trying to see if an email account with name@domain.com already exists but I keep getting this error: googleapiclient.errors.HttpError: <HttpError 403 when requesting https://www.googleapis.com/admin/directory/v1/users/name%domain.comL?alt=json returned "Not Authorized to access this resource/api"> Although I successfully use the users().insert() method from my code with the same credentials. I've tried the "Try it" webpage for this exact request and noticed two things. It worked with the

directory api - get users using orgName

╄→гoц情女王★ 提交于 2019-12-12 04:53:43
问题 I have four sub-organizations defined. (/AdminOrg, /subOrgA, /SubOrgB, /subOrgA/SubOrgAA) my directory.orgunits.list query return below data. I store the return array in a variable called orgUnits[]: http://pastebin.com/Kzud6SAq I have 4 users in my organization. one in each sub-organization. the users.list return below data: http://pastebin.com/6ttSgDSe I am trying to get no. of users within an organization (without including sub organizations in them) Option 1: The query directory.users

Google Drive admin sdk not returning results

泄露秘密 提交于 2019-12-12 03:56:22
问题 We just upgraded our google drive account to unlimited. I'm trying to get google drive activity by calling: https://www.googleapis.com/admin/reports/v1/activity/users/all/applications/drive Even though I know there has been upload and download and other activity I always get the following request body response. What am I doing wrong? { "kind": "admin#reports#activities", "etag": "\"K7weO5KXLrPU3p64O3h2OrP24p0/Vx72S7w5bR8cVoa6z9PWL7D5sM0\"" } note I didn't get new credentials after I upgraded

Email Audit API usage

被刻印的时光 ゝ 提交于 2019-12-12 02:34:38
问题 I am using Email Audit API in a daily basis (setting/deleting monitors). According to the Usage Limits and Quotas, the limit for monitor creation and deletion is 1000 per day. However, its API usage is not showing anywhere. In Google API console, there are two APIs seems related (Admin SDK and Audit API), but none of them is showing the usage of the Email Audit API - after I create/delete a monitor via Email Audit API, either the quota of Admin SDK or Audit API remains unchanged. So I am

Email Audit API - 403 Forbidden

故事扮演 提交于 2019-12-12 01:23:04
问题 I am trying to download a user's mailbox using the Email Audit API. I am getting a 403 Forbidden response to this code (the error occurs on the last line, the call to the UploadPublicKey method): var certificate = new X509Certificate2(System.Web.HttpRuntime.AppDomainAppPath + "key.p12", "notasecret", X509KeyStorageFlags.Exportable); ServiceAccountCredential credential = new ServiceAccountCredential( new ServiceAccountCredential.Initializer(serviceAccountEmail) { Scopes = new[] { "https://apps

google admin SDK for non admin-user

筅森魡賤 提交于 2019-12-12 01:15:35
问题 I created google app in developer console. Enable Admin SDK Enable API access In "Manage OAuth Client access" i added "Authorized API client" with "https://www.googleapis.com/auth/admin.directory.user" scope. Further, i want to get users from my domain. JsonFactory JSON_FACTORY = JacksonFactory.getDefaultInstance(); HttpTransport httpTransport = GoogleNetHttpTransport.newTrustedTransport(); ArrayList<String> scopeList = new ArrayList<>(); scopeList.add(DirectoryScopes.ADMIN_DIRECTORY_USER

GoogleApps Directory APIs To Manage Users

耗尽温柔 提交于 2019-12-11 19:32:20
问题 i am writing a java client to manage users in directory API. i am unable to find where to start. I checked the docs and couldn't find any example on usage of the API's, it was just saying the scopes, the url's required and the format to use. But i am unable to find any examples on connectiong to the GoogleAPpps and creating user or managing them. Please provide any information or links that might be helpful . Thanks 回答1: Hey have you tried out the java client library? https://developers

Google Directory API returns 403 for user_list with showDeleted=true

自闭症网瘾萝莉.ら 提交于 2019-12-11 17:08:32
问题 I thought I had applied all of the necessary scopes / requested the necessary authorizations with the following: "https://www.googleapis.com/auth/admin.directory.customer.readonly", "https://www.googleapis.com/auth/admin.directory.domain.readonly", "https://www.googleapis.com/auth/admin.directory.user.readonly" I am able to query the Google Directory for a user list successfully, but as soon as I start passing show_deleted: "true" I get the following: Caught error forbidden: Not Authorized to

Google admin sdk - user usage reports not available

倖福魔咒の 提交于 2019-12-11 12:13:23
问题 I would like to ask you for help with google admin sdk, User Usage Reports. I got following questions: One of the parameters used to retrieve a usage reports is a date. Unfortunately for current date the reports are not yet available - I must use a date few days in the past. Is there any official rule, recommendation or any advice how to know most recent date for which the reports are already available? Should I query reports for a one day in the past, 3 days, week or...? I just want to have