google-api

How to use a refresh_token to get a new access_token (using Flask-OAuthLib)?

被刻印的时光 ゝ 提交于 2020-01-23 06:32:46
问题 I'm building a website + backend with the FLask Framework in which I use Flask-OAuthlib to authenticate with google. After authentication, the backend needs to regularly scan the user his Gmail. So currently users can authenticate my app and I store the access_token and the refresh_token . The access_token expires after one hour, so within that one hour I can get the userinfo like so: google = oauthManager.remote_app( 'google', consumer_key='xxxxxxxxx.apps.googleusercontent.com', consumer

How to use a refresh_token to get a new access_token (using Flask-OAuthLib)?

▼魔方 西西 提交于 2020-01-23 06:32:13
问题 I'm building a website + backend with the FLask Framework in which I use Flask-OAuthlib to authenticate with google. After authentication, the backend needs to regularly scan the user his Gmail. So currently users can authenticate my app and I store the access_token and the refresh_token . The access_token expires after one hour, so within that one hour I can get the userinfo like so: google = oauthManager.remote_app( 'google', consumer_key='xxxxxxxxx.apps.googleusercontent.com', consumer

Google Service account user interfece

为君一笑 提交于 2020-01-23 04:56:08
问题 How can I login to a Google Service account with the normal web user interface, for example to google drive ? Now I can only login using API using script. 回答1: You cant. A service account is a sudo user type thing. Yes it has a Google drive account, Google calendar ... but you cant log in to the web interface for Service accounts. Option / work around / Tip: There is a slight workaround. You could have the service account give your Google account access to a directory on its Google drive.

Google Play Game Services get achievements list

半世苍凉 提交于 2020-01-23 02:45:49
问题 I'm integrating Google Play Game Services in my game. Now I want to retrieve a list of achievements without starting the achievements intent. I want the list behind that intent so that I can populate my own UI elements with this information. I'm not using the old GooglePlayServicesClient, I'm using the GoogleApiClient! Thanks for your help ;) 回答1: The code to retrieve a list of achievements can be found in this answer. Below is the code snippet - see the linked answer for a full description:

Is Google+ API going to shut down?

*爱你&永不变心* 提交于 2020-01-23 01:08:05
问题 According to this article https://www.engadget.com/2018/10/08/google-shutting-down-google-plus/ Google is planning to shut down its social network Google+ for consumers. I was wondering if the Google+'s api is also going to be removed? In my case I am using this endpoint to retrieve user's public profile. https://www.googleapis.com/plus/v1/people/me 回答1: Yes, Google+ APIs are shutting down. Google+ APIs will be shut down on March 7, 2019 . This includes Google+ Sign-in. Learn more. Google+

How to get more than 100 results from Google Custom Search API

寵の児 提交于 2020-01-22 23:06:10
问题 I am trying to use Google Custom Search API for research purposes in Java. As a result I'm gonna need a big result set for each query. However it seems that I'm limited with first 100 results which is much less than what I need. I use the list method like this: list.setStart(90L); And when I set it to start from index 100 I get this error: com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request { "code" : 400, "errors" : [ { "domain" : "global", "message" : "Invalid

How to get more than 100 results from Google Custom Search API

江枫思渺然 提交于 2020-01-22 23:05:31
问题 I am trying to use Google Custom Search API for research purposes in Java. As a result I'm gonna need a big result set for each query. However it seems that I'm limited with first 100 results which is much less than what I need. I use the list method like this: list.setStart(90L); And when I set it to start from index 100 I get this error: com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request { "code" : 400, "errors" : [ { "domain" : "global", "message" : "Invalid

Google API : Getting a Contacts Photo

南笙酒味 提交于 2020-01-22 13:55:06
问题 I've been able to retrieve everything but the contacts photo by following the API. I can get the img url as well as the gd:etag from the xml returned. Below is the Google API example, and it is the same thing I get, with the value of the attributes being different of course for my contacts. <link rel='http://schemas.google.com/contacts/2008/rel#photo' type='image/*' href='https://www.google.com/m8/feeds/photos/media/liz%40gmail.com/c9012de' gd:etag='"KTlcZWs1bCp7ImBBPV43VUV4LXEZCXERZAc."'>

How to set validation method in Google spreadsheets API

大城市里の小女人 提交于 2020-01-21 09:55:47
问题 I am confused about the new Google Sheets API v4. My question is: how can I set validation rules for specified column(s) in spreadsheet? There is no useful tutorial with description how to use appropriate methods. Result should look like following sample: That validation should be set before data upload (which works fine). My current code: $client = getClient(); $service = new Google_Service_Sheets($client); $fileId = 'my-document-id'; $body = new Google_Service_Sheets

Google API returning different results than website

倖福魔咒の 提交于 2020-01-21 05:22:25
问题 When I do a site-specific search on google.com: site:http://one-month-of-chat-logs.github.io security I get 12 results. I signed up for a custom search engine ( cx: 015271449006306103053:mz6wkimeenc ) and API key, and I get only 3 results when I run the same search: $ curl 'https://www.googleapis.com/customsearch/v1?key=$MY_API_KEY&cx=015271449006306103053%3Amz6wkimeenc&q=security' Why do the results differ? Is my API request actually querying something different than the search I performed