Do I absolutely need OAuth2 Authentication? (For keyword traffic estimating Web app)

59 views
Skip to first unread message

steve

unread,
May 9, 2017, 5:15:18 AM5/9/17
to AdWords API Forum
Hello,

I'm trying to build a Web application for estimating keyword traffic based on this example: https://developers.google.com/adwords/api/docs/samples/php/optimization

But when I try to run the code I get the error: "Fatal error: Class 'Google\AdsApi\Common\OAuth2TokenBuilder' not found in C:\xampp\htdocs\..."

I simply need to access publicly available keyword data, not my own account data nor anyone else's account data. Therefore is it really necessary for me to use OAuth2 authentication?



Sreelakshmi Sasidharan (AdWords API Team)

unread,
May 9, 2017, 11:20:47 AM5/9/17
to AdWords API Forum
Hi Steve, 

I see that you are referring to the PHP sample. Could you confirm that you installed the PHP library using the Composer and following the instructions listed in this page? Composer will take care of installing all the required dependencies for the client library. 

Regarding your question about OAuth, every call issued against AdWords API requires the caller to authenticate and that is done via the OAuth setup. It is true that in your case you are not querying for data belonging to your account. However, the call is issued against the API and hence OAuth cannot be bypassed. The OAuth setup is onetime for a given user login and detailed steps are listed in this page. Please give it a try and I will be happy to assist you if you face any issues with the setup. 

Thanks,
Sreelakshmi, AdWords API Team

steve

unread,
May 10, 2017, 4:29:24 AM5/10/17
to AdWords API Forum
Hi Sreelakshmi,

I had not installed the PHP library using Composer, instead I manually downloaded the package (google-api-php-client-2.1.1_PHP54) from this page: https://github.com/google/google-api-php-client/releases

But now I'll do like you say and try installing the PHP library via Composer. I'll let you know if I have questions regarding setup.

Thanks!
Steve
Reply all
Reply to author
Forward
0 new messages