google-api-java-client

using youtube data in android project

牧云@^-^@ 提交于 2019-11-28 10:21:18
问题 My target is to use youtube instead of server, to store videos. I need youtube provide the following function 1. upload video and get his url . 2. search for video that match developer tag. to do so, i find here those posts Using YouTube Data Api in Android Creating a playlist with Youtube DATA API on Android after i read those posts i install eclipse youtube data plug in and downloaded those file https://code.google.com/p/gdata-java-client/downloads/detail?name=gdata-samples.java-1.47.1.zip

Getting null Refresh token

一世执手 提交于 2019-11-28 09:40:40
问题 I'm using the google-api-java-client version 1.8-beta for oAuth2 authentication with Google accounts. Everything fine until I get the GoogleTokenResponse object, which has the access token but not refresh token. To build the request url I user the following method : ... googleAuthenticationUrl = new GoogleAuthorizationCodeRequestUrl(CLIENT_ID, callBackUrl, scopes).build(); ... When getting the request token I exchange it with an access token in this line : ... GoogleTokenResponse

gdata-java-client + oauth2 + access_token secret

无人久伴 提交于 2019-11-28 09:28:46
I'm currently trying to use the new java client(s) and due to legacy reasons for current state of google libraries, I need to use both the gdata and the new google java client api. Obviously I'd like to use OAuth2 -- however with OAuth2 I am not getting the access token secret -- which causes an issue b/c gdata requires the access token secret. Could anyone pls advise on a workaround eg. - is there a way to use gdata java libraries with only access token(OAuth2) and not access token secret? Code examples(and attempt) do not corroborate this but perhaps I'm doing something incorrectly or do I

Java Google Contacts API Access Service Account Authentication

柔情痞子 提交于 2019-11-28 09:15:33
问题 I'm trying to access Googles Contacts API but my attempt failed already on getting authorized. From other (web) languages i'm used to the APIConsole and the public API-key (authorization). GoogleCredential credential = new GoogleCredential().setAccessToken("<<PublicAPIKey>>"); System.out.println(credential.refreshToken()); // false This way I'm not able to refresh the token and be unsure about using the public-key as accesstoken... Instead I tried over a service account: private static final

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

你。 提交于 2019-11-28 06:56:17
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 )? 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. import com.google.api.client.auth.oauth2.Credential; import com.google.api.client.googleapis.auth.oauth2

Error consuming customerLicense App Marketplace with Service Account OAuth2

蓝咒 提交于 2019-11-28 06:02:15
问题 SOLUTION I figured out how to solve this problem. First of all here is my implementation with Service Account: // Build service account credential. GoogleCredential credential = new GoogleCredential.Builder().setTransport(httpTransport) .setJsonFactory(JSON_FACTORY) .setServiceAccountId(SERVICE_ACCOUNT_EMAIL) .setServiceAccountScopes(Collections.singleton("https://www.googleapis.com/auth/appsmarketplace.license")) .setServiceAccountPrivateKeyFromP12File(new File("/path/to/mykey/key.p12")) //

authorize google calendar api works on personal account but not on google domain account

折月煮酒 提交于 2019-11-28 05:56:45
问题 I need to make a Java application that stores calendar events in employees within a Google Domain. I created the application based on a sample I found on http://code.google.com/p/google-api-java-client/wiki/APIs#Calendar_API Now I wanted to make it work on an account from the google domain and suddenly I'm stuck. I changed the client_secrets.json file with a new one. generated on code.google.com/apis/console for an installed application and now I get a invalid client error: ex = (com.google

Loading Google API Javascript Client Library into Chrome Extension

混江龙づ霸主 提交于 2019-11-28 05:20:37
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" ] }, but then the extension doesn't load. I've also tried injecting the script into the background html

How to access google developer api in android app

依然范特西╮ 提交于 2019-11-28 05:19:18
问题 I am trying to develop an app which needs to access google developer API by using developer email.I have gone through official documentation.I don't understand much.I created client id by following this instructions.https://developers.google.com/android-publisher/authorization But for generating token they mentioned to call this API "https://accounts.google.com/o/oauth2/auth?scope=https://www.googleapis.com/auth/androidpublisher&response_type=code&access_type=offline&redirect_uri=...&client

Invalid grant when accessing Google API

拈花ヽ惹草 提交于 2019-11-28 00:37:23
问题 I'm trying to invoke any of the Google API using "Service account" authorization access. I have downloaded ".pk2" file and activated "URL Shortener API" in Services tab of Google API console. Whenever I try to invoke any API (URL shortener or Adsense). I've got following exception - com.google.api.client.auth.oauth2.TokenResponseException: 400 Bad Request { "error" : "invalid_grant" } at com.google.api.client.auth.oauth2.TokenResponseException.from(TokenResponseException.java:105) at com