Adsense Data Api

89 views
Skip to first unread message

saurabh kumar

unread,
Jul 31, 2019, 9:24:31 AM7/31/19
to AdSense API Forum
hi 

we want to get adsense data report using api.
for that we have download the php client library for google api (https://github.com/googleads/googleads-adsense-examples/tree/master/php-clientlib-1.x/v1.x)
we have created the adsense_report.php and getting the below mentioned error.
Fatal error: Uncaught InvalidArgumentException: missing the required redirect URI in C:\xampp\htdocs\Adsense\google-api-php-client-2.2.3\vendor\google\auth\src\OAuth2.php:651 Stack trace: #0 C:\xampp\htdocs\Adsense\google-api-php-client-2.2.3\src\Google\Client.php(340): Google\Auth\OAuth2->buildFullAuthorizationUri(Array) #1 C:\xampp\htdocs\Adsense\google-api-php-client-2.2.3\adsense_report.php(109): Google_Client->createAuthUrl() #2 {main} thrown in C:\xampp\htdocs\Adsense\google-api-php-client-2.2.3\vendor\google\auth\src\OAuth2.php on line 651 

if anyone can help in getting this resolved.

Ad Sense API

unread,
Jul 31, 2019, 9:36:41 AM7/31/19
to adsen...@googlegroups.com
Hi, Saurabh.

It looks like OAuth is failing. Did you update the client_secrets.json file with your client ID, client secret and redirect URL (http://your/path/adsense-sample.php)?

Check out the README file for all of the steps necessary to get the examples running.

Let me know if you still experience difficulties.

Thanks,
Donovan McMurray, AdSense API Team

ref:_00D1U1174p._5001UEHK6Y:ref
Reply all
Reply to author
Forward
0 new messages