Group: http://groups.google.com/group/adsense-api/topics
- OAuth 2.0 / PHP API / Reports [3 Updates]
- Daniel Mayans <dani.mb90@gmail.com> Jun 03 06:22AM -0700
Maybe I haven't explained well:
Actually, I have stored the refresh token, but, I don't know how to use it inside
this file
<https://github.com/googleads/googleads-adsense-examples/blob/master/php-clientlib-1.x/v1.x/adsense-sample.php>
to avoid the confirmation screen. Can I see an example of PHP code using
the refresh token?
The page that you suggested me doesn't help. It doesn't says anything about
how to use the refresh token.
Thank you!
- "Sérgio Gomes (AdSense API Team)" <adsenseapiadvisor+sergio@google.com> Jun 03 06:35AM -0700
Hi Daniel,
Apologies for that, I should have explained it a bit more clearly.
The "getAccessToken" method is actually a misnomer, as it retrieves both
the access and refresh token (if available). Thus, in the sample you
pointed to, what you're actually storing in the session
<https://github.com/googleads/googleads-adsense-examples/blob/master/php-clientlib-1.x/v1.x/adsense-sample.php#L116>
is both the access and refresh tokens.
In order to make this fully persistent, all you would have to do would be
to store them both in a database or local file, rather than in the session.
You would then retrieve them normally, and initialize the client with them
<https://github.com/googleads/googleads-adsense-examples/blob/master/php-clientlib-1.x/v1.x/adsense-sample.php#L94>
.
Hope this helps!
Cheers,
Sérgio
---
Sérgio Gomes
Developer Relations
Google UK Limited
Registered Office: Belgrave House, 76 Buckingham Palace Road, London SW1W
9TQ
Registered in England Number: 3977902
On Tuesday, 3 June 2014 14:22:17 UTC+1, Daniel Mayans wrote:
- Daniel Mayans <dani.mb90@gmail.com> Jun 03 06:51AM -0700
Okey Sergio, thank you very much!
No comments:
Post a Comment