help dwords_api_php authentication

18 views
Skip to first unread message

garagecod...@gmail.com

unread,
Jun 29, 2017, 5:54:40 AM6/29/17
to AdWords API Forum

hello 

I am designing an application where multiple users can log in to adwords and make use of the apis I currently use the adwords_api_php_4.2.3 library Implement the following code Require_once 'Google / Api / Ads / AdWords / Lib / AdWordsUser.php';      $ Email = 'email';      $ Password = 'password';      $ DeveloperToken = 'token';      $ ApplicationToken = 'ignored';      $ UserAgent = 'agentname';      $ ClientId = 'clientid';      $ User = new AdWordsUser (NULL, $ email, $ password, $ developerToken,          $ ApplicationToken, $ userAgent);       $ User-> LogDefaults ();      $ CampaignService =          $ User-> getCampaignService ('v201702', 'https://adwords.google.com'); At the time of execution throws me the following exception

PHP Fatal error:  Uncaught exception 'AuthTokenException' with message 'Failed t
o get authToken. Reason: 404' in C:\xampp\htdocs\elbueno\src\Google\Api\Ads\Comm
on\Util\AuthToken.php:143



Shwetha Vastrad (AdWords API Team)

unread,
Jun 29, 2017, 1:36:10 PM6/29/17
to AdWords API Forum
Hi, 

All AdWords API calls must be authorized through OAuth2. You need to setup authentication for your application by following this guide. You can then follow this guide to set up the application for API access on behalf of your clients using web flow

Please try this out and let me know if you are able to make successful API requests. 

Regards,
Shwetha, AdWords API Team.
Reply all
Reply to author
Forward
0 new messages