I need to retrieve data from Google Analytics programatically in order to generate some reports, so OAuth 2.0 is not an option since it asks for user authorization..
Is there a way to retrieve data from GA API v3, using the API KEY ?
thanks!
The user must be authenticated to grant your application access to his data. This applies to any use case.
You can certainly use OAuth 2.0. Google offers the possibility to obtain an access token, which can be used by your application to access user data. In this case, the user only needs to be authorized once.
See https://developers.google.com/accounts/docs/OAuth2WebServer#callinganapi for more info about accessing Google API's with an application using OAuth 2.0.
Related
All what I need is in the title, I'm looking for the process to get an access token from OAuth for my google app engine account (It's to use API which isn't in the google libraries).
I already create a OAuth client ID on my google console, but now I don't know what to do, how to get my access token?
PS: It's to use in the proximity beacon API from the server directly
I want get my Google Analytics data. I do not want to see others Google Analytics data, so I don't want to use oAuth2.
In detail I just need have the Analytics Object: ManagementApiReferenceSample.java
I just want to use my google account to get my Google Analytics Data. I don't understand how to use use google-api-java-client to get access with out Oauth2.
For starters you should look into using a service account. By using a service account you can set it up and give it permissions to access your Google Analytics account it will act like any other user but will only have access to your account and you will not need to request access like you do with Oauth2.
Note: Make sure that you grant the Service account access to use the Google Analytics account at the account level. It wont work at the web property or view level. Its the service account email address you use.
There are several examples for using the Google Analytics api with Java client lib. The main one I can find is called hello analyitcs
I have a Java web application that uses Google OAuth for authentication (with this API : http://goo.gl/6wWyT3) and it works fine. However, I need a way to allow only users from a certain Google Apps for Education domain e.g mike#wdu.edu.ng to be able to gain access to the app using Google's OAuth. How do I go about this ??
send users off to Google with a parameter hd=<domain.com> in the authorization request (by modifying buildLoginUrl) to skip the account chooser screen and upon return, check that the claims returned from Google contain the hd claim with a value <domain.com> in getUserInfoJson to enforce the access requirement
While I can use Spring Social framework to get info referred to an user from his account on Twitter or Facebook, is there a way to get info using Klout v2 api?
Actually, it seems an http get request is necessary.
So, how can I use my api key to get this information?
Klout API gives you influence scores and topics for a given user (twitter or google plus). It doesn't give any profile information. Need to use source APIs (wrappers like Spring Social) to retrieve those information. If you want to use klout v2 API for influence scores etc, you can use this Java wrapper - http://code.google.com/p/klout4java/
Is it possible to obtain a OAuth2 token to use with Google APIs, using the android AccountManager? The only other way I know of would be to have a webView and make the user log in to obtain the OAuth2 token, but it would seem to be a lot of work for that many people would want to do, so if I could just obtain it using AccountManager that would be much better. Is there any functionality like this?
AccountManager is not for generating tokens at all - its only for storing credentials related to an Account. These classes are not specific to Google server accounts - you can use them for any type of account. For example, I use them to store OAuth2 tokens for Facebook, Twitter, etc.
You will need to use the Google APIs to generate an OAuth2 token, which you store in an Account using the AccountManager. You need to use the Google APIs, because part of the OAuth2 token generation occurs on the server itself - Google will store a record of the tokens it has given out, and the server accounts that they are related to. If you didn't call the Google APIs to generate the token, Google wouldn't know how to match the token to a Google server account.
Your approach of using a WebView to obtain the OAuth2 token is the correct way to do this.
Once you have the OAuth2 token stored for the Account, you just retrieve it from the AccountManager whenever you want to use it to make a query. So, you only need to generate the OAuth2 token once (unless it expires), and then you keep using it over and over again.