I am developing an application in php with codeigniter that needs to connect to Adwords and I have many questions ...
First of all, I have a test account and I donβt know if Iβm connecting correctly, because I donβt know what I need to specify as DeveloperToken, clientId and defaultServer. Which one is correct?
$username = " my_email@gmail.com "; $password = "my_password"; //Developer Token options $developerToken_1 = "E2SGs1l7gEWWdCfeYSO4oA"; //It not my real token.. $developerToken_2 = " my_email@gmail.com ++USD"; $user = new AdWordsUser(null, $username, $password, $developerToken); //Default Servers //Option 1 $user->SetDefaultServer("https://adwords.google.com/"); //Option 2 $user->SetDefaultServer("https://adwords-sandbox.google.com"); //Option 3 $user->SetDefaultServer("https://sandbox.google.com"); //Client ID //Option 1 $user->SetClientId(' client_id_1+my_email@gmail.com '); //Option 2 $user->SetClientId('1234567890');
I think I need to use adwords v201306 version
$campaignService = $user->GetService('CampaignService', 'v201306');
If I use https://adwords.google.com/ "as a Server, I get:
Uncaught exception 'OAuth2Exception' with message '{ "error" : "invalid_client" }'
With other servers, I get:
A PHP Error was encountered Severity: Warning Message: SoapClient::SoapClient(https://sandbox.google.com/api/adwords/cm/v201306/CampaignService?wsdl): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found Filename: Lib/AdsSoapClient.php
or
A PHP Error was encountered Severity: Warning Message: SoapClient::SoapClient(https://adwords-sandbox.google.com/api/adwords/cm/v201306/CampaignService?wsdl): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found Filename: Lib/AdsSoapClient.php
What should I do? I read a lot in too many websites and I donβt know how I can solve it.
Thanks a lot!
source share