google-api-python-client


Google API/get directory contacts

耗尽温柔 提交于 2020-02-21 14:37:40
问题 I need get list of contacts/phones from google buisness directory listing. I have tried Google Contacts api, it work ok for all contacts under "My Contacts", but not allow show "Directory" contacts. What i have use/how to access thoose contacts(company ones)? 回答1: To add users to the Global Address List (GAL), use the Domain Shared Contacts API. It's similar to the regular Contacts API but is only accessible to admins and has a special URL. 回答2: Note that to get all users on an account is now

Google API/get directory contacts

廉价感情. 提交于 2020-02-21 14:35:25
问题 I need get list of contacts/phones from google buisness directory listing. I have tried Google Contacts api, it work ok for all contacts under "My Contacts", but not allow show "Directory" contacts. What i have use/how to access thoose contacts(company ones)? 回答1: To add users to the Global Address List (GAL), use the Domain Shared Contacts API. It's similar to the regular Contacts API but is only accessible to admins and has a special URL. 回答2: Note that to get all users on an account is now

Google API Drive V3 retrieving drive storage space used

*爱你&永不变心* 提交于 2020-02-08 10:05:05
问题 I'm using a google service account to retrieve the usage of data from different users. I'm using google's python client to authenticate and retrieve the data. Code service = build('drive', 'v3', credentials=auth) result = service.about().get(email).execute(); result = result.get("storageQuota", {}) I keep getting the following error: method() takes 1 positional argument but 2 were given I want to be able to get it from a specific user's drive information using the email as an identifier. 回答1:

Google API client secrets error (Python)

点点圈 提交于 2020-01-23 11:42:46
问题 I want to retrieve data from Google analytics. I have created a service account in the console and I am using Google's Python ( hello_analytics_api_v3.py ) code to access the data. I have copied the client_secrets.json into my folder but get this error: *SystemExit: WARNING: Please configure OAuth 2.0 To make this sample run you will need to populate the client_secrets.json file found at:* What should I do? I am using Python 2.7. 回答1: Ensure the terminal is pointing to the same path directory

Python FileNotFoundError: [Errno 2] No such file or directory

我只是一个虾纸丫 提交于 2020-01-07 02:13:06
问题 I have the following snippet from a script credentials = ServiceAccountCredentials.from_json_keyfile_name('tok.json', ['https://www.googleapis.com/auth/analytics.readonly']) This is for auth in google analytics But when I run the script on my site, the logs report the following error: FileNotFoundError: [Errno 2] No such file or directory: 'tok.json' I tried putting tok.json in all places (directories?) I can think of on the server, but the error does not disappear 回答1: I had this same error.

using /upload urls with Google API client

陌路散爱 提交于 2020-01-04 14:37:29
问题 Consider this: I am fetching rawbody messages by this call: service.users().messages().get(userId='me', format='raw', id=msgid) Then I am pushing rawbody messages by this Call: service.users().messages().insert(userId='me', body=message) Now when the mails contain attachments bigger 5MB, I encounter 413 "Request Entity Too Large.", and I can't push mails. GMail API messages.insert Documentation advices to use POST https://www.googleapis.com/upload/gmail/v1/users/userId/messages instead of

Empty Google Drive Trash with Python

折月煮酒 提交于 2020-01-04 14:07:04
问题 I am trying to empty my google drive trash bin with the API, but with no luck. I have tried using the requests library, and the script runs through without errors, but the drive trash is not deleted. I have been able to get files via the API, but not delete or empty the trash. Seems I should be able to just send an http request, but this is proving far more difficult for me than it seems it should be. Any advice would be greatly appreciated. Here is what I have. I am not even getting a json

How to authenticate with Google Spreadsheets API using Python client / discovery service?

空扰寡人 提交于 2020-01-03 04:25:41
问题 I'm using Python 2.7 and the client library for Google API which I am trying to use to get authenticated access to Spreadsheets like so: # sa == Service Account scope = 'https://spreadsheets.google.com/feeds' credentials = SignedJwtAssertionCredentials(sa_id, sa_key, scope) http = httplib2.Http() http = credentials.authorize(http) build('spreadsheets', 'v2', http=http) Note this is from a client script and not in Google App Engine. The output of the above is: File "/Library/Python/2.7/site

Google Contacts API - Accessing Other Users

一曲冷凌霜 提交于 2020-01-03 02:01:48
问题 I am trying to use the Google Contacts API and the Python / GDATA client handlers to access Contacts via OAuth 2.0 for users in the domain. I'm ultimately wanting to create a web service to add contacts for users, but the first step is getting this test working. I can access my own Contacts just fine if I use the default URI. However, when I pass in the email address to construct the URI for another user, I can't seem to access the other user's Contacts. Here is the code that I'm using:

Cloud Storage API requests from GAE - 403 Access not configured

做~自己de王妃 提交于 2020-01-01 16:51:24
问题 My GAE app is trying to manipulate files stored on Google Cloud Storage. The files are stored in the default bucket for my app. I already managed to read/write files to that bucket using the GCS Python Client Library (https://developers.google.com/appengine/docs/python/googlecloudstorageclient/). Unfortunately it does not support copy. Instead, I'm trying the JSON API with the API Client Library (https://google-api-client-libraries.appspot.com/documentation/storage/v1/python/latest/storage_v1

工具导航Map