Re: [google-appengine] Access AdSense Management API reports from App Engine Java Application

2013-08-07 Thread Vinny P
On Wed, Aug 7, 2013 at 5:13 AM, Holger Kraus  wrote:

> what I'm trying to do is creating a simple Java application using App
> Engine which retrieves my current earnings from day x to day y.
> As far as I understand I need to acquire an OAuth token first within my
> application and attach it to my request. My questions in this regard are:
> 1. Am I correct with this assumption
>


Yes, that's correct. See
https://developers.google.com/adsense/management/getting_started#auth for
an explanation of how it works.


On Wed, Aug 7, 2013 at 5:13 AM, Holger Kraus  wrote:

> 2. If so, why would a fixed, server based application need to acquire an
> OAuth token?
>


Because there needs to be some way of authenticating and proving to the
server that the application actually represents you, and not some malicious
third-party. OAuth is simply the best, most secure way of proving your
identity.


On Wed, Aug 7, 2013 at 5:13 AM, Holger Kraus  wrote:

> 3. Is there any easy way to retrieve such a token and afterwards attach it
> to my requests automatically? All the tutorials I see on that part seem to
> require some user interaction, which won't work for my use case where an
> App Engine app simply wants to retrieve some metrics...
>


The initial OAuth token retrieval will have to be done by a person (after
all, somebody has to input their username and password into the prompts).
However after the server sends back the OAuth token, the application can
save it and use it for an indefinite period of time (unless you invalidate
the token specifically).



-
-Vinny P
Technology & Media Advisor
Chicago, IL

App Engine Code Samples: http://www.learntogoogleit.com

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/groups/opt_out.




[google-appengine] Access AdSense Management API reports from App Engine Java Application

2013-08-07 Thread Holger Kraus
Hi everyone,

what I'm trying to do is creating a simple Java application using App 
Engine which retrieves my current earnings from day x to day y.
According to the Management API documentation the request required for this 
would look something like this:
https://www.googleapis.com/adsense/v1.1/reports?key=mykey&alt=csv&endDate=2013-08-07&startDate=2013-06-07&metric=EARNINGS

However if I simply call this URL from within my App I get an "Login 
Required"

As far as I understand I need to acquire an OAuth token first within my 
application and attach it to my request. My questions in this regard are:

1. Am I correct with this assumption>
2. If so, why would a fixed, server based application need to acquire an 
OAuth token?
3. Is there any easy way to retrieve such a token and afterwards attach it 
to my requests automatically? All the tutorials I see on that part seem to 
require some user interaction, which won't work for my use case where an 
App Engine app simply wants to retrieve some metrics...

Any help would be much appreciated :)

Thanks,
Holger

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/groups/opt_out.