google-api-java-client

Google push notifications - Unauthorized WebHook callback channel

耗尽温柔 提交于 2019-11-27 01:52:24
I'm facing problem with Google push notifications (for drive). I use service account which works perfectly for all other drive operations except drive changes watch. Below is application code which now fails with "Unauthorized WebHook callback channel" exception. I also dumped requests and responses which are generated when drive.changes.watch.execute is called. Target notification address is whitelisted in APIs & auth Push control panel (I even listed it in Javascript origins and referrers) and now I'm stuck with this 401 Unauthorized error. Does someone know where I'm making mistake? Thanks

What is an example of using OAuth 2.0 and Google Spreadsheet API with Java?

隐身守侯 提交于 2019-11-27 01:37:47
问题 Where is example code showing how to use the Google Data Java Client Library and its support for OAuth 2.0 with the Google Spreadsheet API (now called the Google Sheets API )? 回答1: Answer moved from original question to match site "Q and A" format. The Google Data Java Client Library supports OAuth 2.0 . Unfortunately, there are no complete samples in the library showing how to use it with the Google Spreadsheet API . Here is an example that has worked for me. I hope someone find it helpful.

Loading Google API Javascript Client Library into Chrome Extension

血红的双手。 提交于 2019-11-27 00:42:54
问题 I've been trying to wed the google api javascript client library with a chrome extension for a while now, but it seems the chrome extension has a terrible case of cold feet. The link to the script is https://apis.google.com/js/client.js Downloading the files is messy because the script actually loads other scripts. I've tried including it in the manifest manifest.json (excerpt) "background": { "scripts": [ "background.js", "https://apis.google.com/js/client.js?onload=callbackFunction" ] },

Migrating 50TB data from local Hadoop cluster to Google Cloud Storage

五迷三道 提交于 2019-11-26 23:08:21
I am trying to migrate existing data (JSON) in my Hadoop cluster to Google Cloud Storage. I have explored GSUtil and it seems that it is the recommended option to move big data sets to GCS. It seems that it can handle huge datasets. It seems though that GSUtil can only move data from Local machine to GCS or S3<->GCS, however cannot move data from local Hadoop cluster. What is a recommended way of moving data from local Hadoop cluster to GCS ? In case of GSUtil, can it directly move data from local Hadoop cluster(HDFS) to GCS or do first need to copy files on machine running GSUtil and then

Exception using HttpRequest.execute(): Invalid use of SingleClientConnManager: connection still allocated

风格不统一 提交于 2019-11-26 17:18:03
I'm using google-api-client-java 1.2.1-alpha to execute a POST request, and am getting the following stacktrace when I execute() the HttpRequest. It happens immediately after I catch and ignore a 403 error from a previous POST to the same URL, and re-used the transport for the subsequent request. (It's in a loop inserting multiple entries to the same ATOM feed). Is there something I should be doing to 'clean up' after a 403? Exception in thread "main" java.lang.IllegalStateException: Invalid use of SingleClientConnManager: connection still allocated. Make sure to release the connection before

Uploading image from Android to GCS

夙愿已清 提交于 2019-11-26 12:14:56
问题 I am trying to upload an image from Android directly to Google cloud storage. But the API does not seem to work. They have some Java samples which are tied to the App engine. I don\'t see any sample which is proven to work on Android. On Android, I tried using the json api to upload an image. I am able to upload an image object but it seems to be corrupt. Moreover generating the authentication token seems to be tricky too. I am struck with this right now. Did anyone on this earth ever tried

Getting a 403 - Forbidden for Google Service Account

拥有回忆 提交于 2019-11-26 11:34:12
问题 I am trying to get an access token for Google Service Account. Following is my code - String SERVICE_ACCOUNT_EMAIL = \"edited@developer.gserviceaccount.com\"; List scope = new ArrayList(); scope.add(\"https://www.googleapis.com/auth/admin.directory.user\"); String keyFile = \"C:\\\\edited-privatekey.p12\"; HttpTransport HTTP_TRANSPORT = new NetHttpTransport(); JsonFactory JSON_FACTORY = new JacksonFactory(); GoogleCredential credential = new GoogleCredential.Builder() .setTransport(HTTP

Google Drive API doesn&#39;t play well with ProGuard (NPE)

血红的双手。 提交于 2019-11-26 10:58:47
问题 Currently, I\'m having experience that, a piece of code, which makes use of Google Drive API is running fine without introducing ProGuard. However, after introducing ProGuard, I\'m getting the following run-time error. at java.lang.Thread.run(Thread.java:856) Caused by: java.lang.NullPointerException at com.google.api.client.util.Types.getActualParameterAtPosition(Types.java:329) at com.google.api.client.util.Types.getIterableParameter(Types.java:309) at com.google.api.client.json.JsonParser

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

一个人想着一个人 提交于 2019-11-26 10:25:54
问题 Lately, I have been working a lot with Google APIs on Android especially Analytics, AdSense and Tasks API. I have seen some samples provided by Google where they use this statement to obtain a GoogleAccountCredential object https://code.google.com/p/google-api-java-client/source/browse/tasks-android-sample/src/main/java/com/google/api/services/samples/tasks/android/TasksSample.java?repo=samples credential = GoogleAccountCredential.usingOAuth2(this, Collections.singleton(TasksScopes.TASKS));

Google push notifications - Unauthorized WebHook callback channel

我只是一个虾纸丫 提交于 2019-11-26 09:48:35
问题 I\'m facing problem with Google push notifications (for drive). I use service account which works perfectly for all other drive operations except drive changes watch. Below is application code which now fails with \"Unauthorized WebHook callback channel\" exception. I also dumped requests and responses which are generated when drive.changes.watch.execute is called. Target notification address is whitelisted in APIs & auth Push control panel (I even listed it in Javascript origins and