Group: http://groups.google.com/group/adsense-api/topics
- Match "my" day to "Adsense" day [1 Update]
- Fatal Error in Adsense example in google-api-php-client [1 Update]
- How do I generate Authorization header value for OAuth2? [1 Update]
- Error Invalid Grant w/ refresh token [1 Update]
- PHP Server to Server example [2 Updates]
- "Raúl Mellado" <raulmellado@gmail.com> Mar 23 02:08AM -0700
Hi,
I am trying to build a WordPress plugin that will show daily visitors
(plus some other "timed" data) next to daily Adsense earnings for that
blog; now my question is, how do I match WordPress & Adsense timezones?
For Wordpress there is no problem, as from PHP I can know the blog
timezone, and the time for each visit; but what about Adsense? Is there a
way to retrieve the Adsense timezone? Is there a workaround for achieving
this?
Thanks a lot in advance to the great Adsense API support team!
Raul
- "Raúl Mellado" <raulmellado@gmail.com> Mar 23 02:03AM -0700
Thanks a lot for your really useful help, Silvano. Everything on my side
is working now thanks to your great support!
On Thursday, March 1, 2012 11:29:46 PM UTC+12, Silvano Luciani wrote:
- Vaibhav <asfe-next@oversee.net> Mar 22 10:10AM -0700
Can I use the same refresh token for a long period of time? For instance to
get a new access token every 2 hours? Thus my script would have requested
12 access tokens in a day, 360 access tokens in a month and so on...
I am aware of the fact that I am sending my refresh token,client secret to
google under HTTPS. How does it make it better than sending
username/password under HTTPS?
On Thursday, March 22, 2012 2:05:27 AM UTC-7, Silvano Luciani wrote:
- Eric Haskins <eric@voodoo.com> Mar 22 09:14AM -0700
Ok so I get an access token and a Refresh token
I am writing the code so my server can get a new access token if it
expires (terrible for Server to Server but I guess google doesnt think
so)
$data = array(
'client_id' => 'XXXXXXXXXXXXXXXXXXX.apps.googleusercontent.com',
'client_secret' => 'XXXXXXXXXXXXXXXXXXX',
'refresh_token' => 'XXXXXXXXXXXXXXXXXXX',
'grant_type' => 'refresh_token'
);
$ch = curl_init("https://accounts.google.com/o/oauth2/token");
curl_setopt($ch,CURLOPT_POST,true);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch,CURLOPT_POSTFIELDS,$data);
$resp = curl_exec($ch);
print_r(json_decode($resp));
RESULT:
[error] => invalid_grant
Scopes were
'https://www.googleapis.com/auth/adsense',
'https://www.googleapis.com/auth/adsense.readonly',
The structure is right out of the Documentation. Is there anyone here
that has managed to access the AdSense Management API with PHP without
using a web app i.e Server to Server with OAuth2 ??? I can do it all
day long with Twitter but for some reason but google's version seems
be all sorts of difficult.
Thx
Eric
- Eric Haskins <eric@voodoo.com> Mar 22 09:04AM -0700
> If that's not the case, you can try to ask for help or examples for
> other APIs in one of the following forums:
> OAuth 2.0 developer's forum:https://groups.google.com/forum/#!forum/oauth2-dev
Silvano,
Then why even put it in your docs??? Seriously and I mean no
disrespect if you say in the Docs "Here choose from these methods to
link your application" Oh ok ours is a server to server application
so we choose it but we cant find any documentation on how to query or
create the JWT (which I figured out but have no clue how to use now).
If it isnt documented why even show the option I would think Google is
better than that. The OAuth implementation is weird and it doesnt
seem to fit with a stats server coming in and needing to get the daily
stats if you have to have a person go and click an "Authorize"
button. I have tried using the refresh token method and my server
keeps getting a
[error] => invalid_grant
Eric Haskins
Voodoo.Com
- Silvano Luciani <silvano.luciani@google.com> Mar 22 09:34AM -0700
Hello Eric,
the refresh token method should work fine, are you using the Google
API PHP Client Library?
If that's the case, are the AdSense examples working for you?
http://code.google.com/p/google-api-php-client/source/browse/#svn%2Ftrunk%2Fexamples%2Fadsense
Cheers,
Silvano
--
Silvano Luciani | Developer Programs Engineer
Google UK Limited
Registered Office: Belgrave House, 76 Buckingham Palace Road, London
SW1W 9TQ
Registered in England Number: 3977902
You received this message because you are subscribed to the Google Group adsense-api.
You can post via email.
To unsubscribe from this group, send an empty message.
For more options, visit this group.
You received this message because you are subscribed to the Google Groups "AdSense API Forum" group.
To post to this group, send email to adsense-api@googlegroups.com.
To unsubscribe from this group, send email to adsense-api+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/adsense-api?hl=en.
No comments:
Post a Comment