Access to Google API – GoogleAccountCredential.usingOAuth2 vs GoogleAuthUtil.getToken()

The Google APIs Client Library for Java is as the name suggests a library for accessing Google APIs and it is available for several platforms such as Java (in general) and Android while the Google Play Services and GoogleAuthUtil is only available on Android. By looking at the wiki page of the project it is … Read more

What is the fastest way to update a google spreadsheet with a lot of data through the spreadsheet api?

I was able to speed up the batch request provided in the official API http://code.google.com/apis/spreadsheets/data/3.0/developers_guide.html#SendingBatchRequests by skipping the QUERY part before the UPDATE. So this is what they have in the example: // Prepare the update // getCellEntryMap is what makes the update fast. Map cellEntries = getCellEntryMap(ssSvc, cellFeedUrl, cellAddrs); CellFeed batchRequest = new CellFeed(); … Read more

Using base64-encoded images with HtmlService in Apps Script

To get the encoded base64 string in the first place from Google Drive files: GS var response = UrlFetchApp.fetch(‘https://googledrive.com/host/fileId/name.png’); var blob = response.getBlob(); var bytes = blob.getBytes(); var base64String = Utilities.base64Encode(bytes); Logger.log(base64String); // now copy and paste into html HTML <img src=”data:image/png;base64, <base64String>” alt=”img name” />

Google API OAuth2, Service Account, “error” : “invalid_grant”

After some investigations I found, that Google API does not work as expected with your personal account @gmail.com. You should have organization domain account in Google in format you@your_organisation_domain Then, what is also pretty confusing, there is documentation at Google Drive API page, with “Delegate domain-wide authority to your service account” section not mentioned at … Read more

Google API How to connect to receive values from spreadsheet

I finally got it working, despite all attempts from the documents to make it look like impossible, here is my setup: google api for OAuth2 php lib; here: https://code.google.com/p/google-api-php-client/ google spreadsheet api php lib; here: https://github.com/asimlqt/php-google-spreadsheet-client You will need to create the credentials on the API Console: https://console.developers.google.com/ There you will need to first create … Read more