google-api

Update google spreadsheet using python client API on GAE app

房东的猫 提交于 2019-12-21 23:18:14
问题 I've got a google spreadsheet owned by a GAE service account and I want my GAE Python app to update a cell in one of the rows. Based on some reading, these are my findings: the spreadsheets service is old-school. It's a Google Data API and most Google services are now on the Google API platform. For Google API services, one can use a service account to do two-legged oauth2 access, but not for Google Data API services. Oh, it seems one can do two-legged oauth on Google Data API services, but

How to create a Folder with Google Drive REST AP and HTTPClient?

微笑、不失礼 提交于 2019-12-21 23:12:01
问题 I am using Google Drive REST API with HTTPClient to create a folder. The REST API is document here Please note that the REST AP Request executes -- but uses the wrong data: tt creates a new file called "untitled" and puts my json there. I have tried different methods of building the POST request with HTTPClient which execute successfully -- but somehow the Google Drive responds with creating a file and returns this data and ignores POST data that I submit. This is what the server reponds with

Googlesheet api php - filter query

纵然是瞬间 提交于 2019-12-21 23:05:18
问题 I would like to get filtered data from a google spreadsheet. For example if I have a column Name with values John, David, John => I would like to be able to get all the rows that have the Name = John . $range = 'Sheet1!A2:A4'; $response = $service->spreadsheets_values->get($spreadsheetId, $range); $values = $response->getValues(); This gets me all the values within the range. I don't know how can I add a filter depending on the Name value. Any help appreciated 来源: https://stackoverflow.com

Google Chart Api make use of datetime value

删除回忆录丶 提交于 2019-12-21 22:54:21
问题 Hello I want in my chart to display the datetime, I made some search over the stack and I found similaer problems like this one but I could not understand how to fix that. The part of the code that i believe i should change is the below.. <?php $DB_NAME = 'project'; $DB_HOST = 'localhost'; $DB_USER = 'root'; $DB_PASS = 'smogi'; include_once 'header.php'; $view = ($_GET['view']); $username2 =$_SESSION['username']; $firstDate= $_POST['firstdatepicker']; $lastDate= $_POST['lastdatepicker'];

Why does using the Google APIs Python client in appengine with GAE_USE_SOCKETS_HTTPLIB result in ResponseNotReady

拜拜、爱过 提交于 2019-12-21 22:32:05
问题 The code will work just fine in the SDK, but on Google AppEngine, it explodes: File "./oauth2client/util.py", line 137, in positional_wrapper File "./googleapiclient/discovery.py", line 197, in build File "./oauth2client/util.py", line 137, in positional_wrapper File "./oauth2client/client.py", line 563, in new_request File "./httplib2/__init__.py", line 1608, in request File "./httplib2/__init__.py", line 1350, in _request File "./httplib2/__init__.py", line 1306, in _conn_request File "

Detect revoked permission for App in Google API

≡放荡痞女 提交于 2019-12-21 21:00:32
问题 I am using the PHP Google client library. I successfully get a token and refresh token from user/google to use with the API. As soon as the user revokes the permission for my website in Googles settings on the Google page i get following error: Error calling GET https://www.googleapis.com/calendar/v3/users/me/calendarList: (401) Invalid Credentials That is expected behavior since the user revoked my permission. However, how do I detect that a user revoked that access? Currently i do the

How to get OAuth2 access token with Google API PHP client?

若如初见. 提交于 2019-12-21 20:46:22
问题 I'm trying to get an OAuth access token to import some data into the fusion table. I'm trying to use the Google API PHP client. I have created a service account for that purpose, and am using the code, mostly from the serviceAccount example: function access_token() { $client = new Google_Client(); $client->setAuthClass ('Google_OAuth2'); // ^ Don't know if this line is required, // ^ but it fails just as well without it. $client->setApplicationName ('Mysite.dom.ain'); $client-

Unable to get access and refresh token after authenticating with Google API

冷暖自知 提交于 2019-12-21 20:44:08
问题 I followed this awesome tutorial to get the access and refresh tokens once the user logged in with their google account, but I always this response when I call GetAccessCode() : { "error": "invalid_request" } Here's my code: var url = window.location.href; if (url.indexOf("code=") > 0) { //Once the user signed in with Google var code_starts = url.indexOf("code="); var code = url.substring((code_starts + 5), url.length); alert("Code= " + code); GetAccessTokens(code); } else if (url.indexOf(

how to get the client/user location details

孤街醉人 提交于 2019-12-21 20:39:00
问题 In my application I want to track the client/user location to store in database. I'm using this code to get the user IP Address string VisitorsIPAddr = string.Empty; if (HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"] != null) { VisitorsIPAddr = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"].ToString(); } else if (HttpContext.Current.Request.UserHostAddress.Length != 0) { VisitorsIPAddr = HttpContext.Current.Request.UserHostAddress; } ipAddress =

Google Drive API - too slow.

你离开我真会死。 提交于 2019-12-21 20:04:37
问题 I've just working on Google Drive API. I have one problem, it's too slow. I use methods like in the Documentation. For example: List<File> getFilesByParrentId(String Id, Drive service) throws IOException { Children.List request = service.children().list(Id); ChildList children = request.execute(); List<ChildReference> childList = children.getItems(); File file; List<File> files = new ArrayList<File>(); for (ChildReference child : childList) { file = getFilebyId(child.getId(), service); if