- 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" <email@example.com> Mar 23 02:08AM -0700
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
Thanks a lot in advance to the great Adsense API support team!
- "Raúl Mellado" <firstname.lastname@example.org> 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 <email@example.com> 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 <firstname.lastname@example.org> 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
$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");
$resp = curl_exec($ch);
[error] => invalid_grant
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.
- Eric Haskins <email@example.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
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
- Silvano Luciani <firstname.lastname@example.org> Mar 22 09:34AM -0700
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?
Silvano Luciani | Developer Programs Engineer
Google UK Limited
Registered Office: Belgrave House, 76 Buckingham Palace Road, London
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 email@example.com.
To unsubscribe from this group, send email to firstname.lastname@example.org.
For more options, visit this group at http://groups.google.com/group/adsense-api?hl=en.