Success!

Note

Error

Session expiration Your session is going to expireClick here to extend

Budget:

Small project <800

Posted on

8/24/12 1:16 AM

Buyer:

Isa***

This project has expired

Why don't you register anyway? We are sure that you will find many similar projects out of the thousands waiting for you!

Post similar project now

Description

Hi,

 

I am interested in using the Google Analytics API but I have stuck I have code for use it is very specific 

 

Could somebody help me please.

 

The code is some thing like this I cant retrieve the Access Token and get data from the user I want learn I am learning it. Any help?

------

 

public GoogleOAuthParameters setTokenValues() throws NoSuchAlgorithmException, OAuthException { String CONSUMER_KEY = "[OBSCURED].apps.googleusercontent.com"; String CONSUMER_SECRET = "FXxnlK8oWlW1CWnLK4TeEILQ"; GoogleOAuthParameters oauthParameters = new GoogleOAuthParameters(); oauthParameters.setOAuthConsumerKey(CONSUMER_KEY); oauthParameters.setOAuthConsumerSecret(CONSUMER_SECRET); oauthParameters.setScope("https://www.google.com/analytics/feeds"); oauthParameters.setOAuthCallback("http://www.evaluefe.com"); OAuthSigner Signer = new OAuthHmacSha1Signer(); GoogleOAuthHelper oauthHelper = new GoogleOAuthHelper(Signer); try { oauthHelper.getUnauthorizedRequestToken(oauthParameters); String a= oauthParameters.getOAuthToken(); String code="code=4%2Fkh0CL1lM5INeOdYVMfHfky0B5xDn.cjhfh9JsrXMaOl05ti8ZT3ZRs92ocgI&redirect_uri=https%3A%2F%2Fdevelopers.google.com%2Foauthplayground&client_id=[OBSCURED].apps.googleusercontent.com&scope=&client_secret=************&grant_type=authorization_code"; String requestQuery = oauthHelper oauthParameters.setOAuthVerifier("eXoIdbELXJMRl_PIaw-9LJU"); String accessToken=oauthHelper.getAccessToken(oauthParameters); System.out.println(accessToken+"String accessToken=oauthHelper.getAccessToken(oauthParameters);");

 

Many Thanks