URGENT: What should I enter to clientId?

1,247 views
Skip to first unread message

Halil Akın

unread,
Mar 3, 2012, 3:31:17 PM3/3/12
to adwor...@googlegroups.com
I have an MCC account and i am trying to make some tests in Sandbox. I entered my MCC account's email and password. I also entered the developer token as email++TRY. However, I couldn't figure out what to enter to Client id field. Whatever I wrote, it gave me an error. Can you help me on it?

Ewan Heming

unread,
Mar 4, 2012, 12:45:59 AM3/4/12
to adwor...@googlegroups.com
Five accounts with randomly assigned customer ids are created when you first make a call to the sandbox: Call either the InfoService or ServicedAccountService to list them; you don't need to assign a clientId to call these services.

Anash P. Oommen

unread,
Mar 5, 2012, 6:20:47 AM3/5/12
to adwor...@googlegroups.com
Hi Halil,

Further to what Ewan mentioned, you can initialize the sandbox by calling CampaignService::get(). When you make the first call, you don't need to provide a customerId.

Cheers,
Anash P. Oommen,
AdWords API Advisor.

Halil Akın

unread,
Mar 5, 2012, 7:37:37 AM3/5/12
to adwor...@googlegroups.com
How do I make that call via PHP? I recently started working on API. Can you send me a code sample?

Ewan Heming

unread,
Mar 5, 2012, 8:24:50 AM3/5/12
to adwor...@googlegroups.com
If you're using PHP, you could try out the tutorial I put on my blog: http://www.ewanheming.com/2011/12/ppc-software-development/adwords-api/using-the-adwords-api-sandbox

Hope it helps....

hakin

unread,
Mar 5, 2012, 8:38:51 AM3/5/12
to adwor...@googlegroups.com
I am getting this error :(


( ! ) Warning: SoapClient::SoapClient() [soapclient.soapclient]: Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in C:\wamp\www\google\src\Google\Api\Ads\Common\Lib\AdsSoapClient.php on line 163
Call Stack
#TimeMemoryFunctionLocation
10.0012700960{main}( )..\test.php:0
20.02601648064AdWordsUser->GetService( )..\test.php:24
30.43121649544AdsUser->GetServiceSoapClient( )..\AdWordsUser.php:225
40.43121649544SoapClientFactory->GenerateSoapClient( )..\AdsUser.php:128
50.44323340848SoapClientFactory->GenerateServiceClient( )..\SoapClientFactory.php:82
60.44333345680CampaignService->__construct( )..\SoapClientFactory.php:149
70.44343346992AdWordsSoapClient->__construct( )..\CampaignService.php:5686
80.44343346992AdsSoapClient->__construct( )..\AdWordsSoapClient.php:53
90.44343349480SoapClient->SoapClient( )..\AdsSoapClient.php:163

( ! ) Warning: SoapClient::SoapClient() [soapclient.soapclient]: I/O warning : failed to load external entity "https://adwords-sandbox.google.com//api/adwords/cm/v201109/CampaignService?wsdl" in C:\wamp\www\google\src\Google\Api\Ads\Common\Lib\AdsSoapClient.php on line 163
Call Stack
#TimeMemoryFunctionLocation
10.0012700960{main}( )..\test.php:0
20.02601648064AdWordsUser->GetService( )..\test.php:24
30.43121649544AdsUser->GetServiceSoapClient( )..\AdWordsUser.php:225
40.43121649544SoapClientFactory->GenerateSoapClient( )..\AdsUser.php:128
50.44323340848SoapClientFactory->GenerateServiceClient( )..\SoapClientFactory.php:82
60.44333345680CampaignService->__construct( )..\SoapClientFactory.php:149
70.44343346992AdWordsSoapClient->__construct( )..\CampaignService.php:5686
80.44343346992AdsSoapClient->__construct( )..\AdWordsSoapClient.php:53
90.44343349480SoapClient->SoapClient( )..\AdsSoapClient.php:163

( ! ) Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://adwords-sandbox.google.com//api/adwords/cm/v201109/CampaignService?wsdl' : failed to load external entity "https://adwords-sandbox.google.com//api/adwords/cm/v201109/CampaignService?wsdl" in C:\wamp\www\google\src\Google\Api\Ads\Common\Lib\AdsSoapClient.php on line 163
Call Stack
#TimeMemoryFunctionLocation
10.0012700960{main}( )..\test.php:0
20.02601648064AdWordsUser->GetService( )..\test.php:24
30.43121649544AdsUser->GetServiceSoapClient( )..\AdWordsUser.php:225
40.43121649544SoapClientFactory->GenerateSoapClient( )..\AdsUser.php:128
50.44323340848SoapClientFactory->GenerateServiceClient( )..\SoapClientFactory.php:82
60.44333345680CampaignService->__construct( )..\SoapClientFactory.php:149
70.44343346992AdWordsSoapClient->__construct( )..\CampaignService.php:5686
80.44343346992AdsSoapClient->__construct( )..\AdWordsSoapClient.php:53
90.44343349480SoapClient->SoapClient( )..\AdsSoapClient.php:163

Ewan Heming

unread,
Mar 5, 2012, 8:54:27 AM3/5/12
to adwor...@googlegroups.com
Make sure you've got the SOAP and SSL extensions enabled for PHP.

hakin

unread,
Mar 5, 2012, 9:15:20 AM3/5/12
to adwor...@googlegroups.com
I checked it again both are enabled. What account information should we enter? MCC account or a regular Adwords account? I tried both and still the same error, anyway :( 

Ewan Heming

unread,
Mar 5, 2012, 10:36:57 AM3/5/12
to adwor...@googlegroups.com
This error message actually looks like you aren't connected to the Internet; are you using a proxy server or something?

hakin

unread,
Mar 5, 2012, 10:42:09 AM3/5/12
to adwor...@googlegroups.com
I checked that too but I am not behind proxy right now. I am using WAMP and I will try to upload it to my server. I will post if it works on the internet.

hakin

unread,
Mar 5, 2012, 6:31:57 PM3/5/12
to adwor...@googlegroups.com
I tested that code on server but it is still the same error :(

Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://adwords-sandbox.google.com//api/adwords/mcm/v201109/ServicedAccountService?wsdl' : failed to load external entity "http://adwords-sandbox.google.com//api/adwords/mcm/v201109/ServicedAccountService?wsdl" in  

Ewan Heming

unread,
Mar 5, 2012, 10:34:13 PM3/5/12
to adwor...@googlegroups.com
You've got the AdWords API server set as http://adwords-sandbox.google.com/, but it should use https; try changing it to https://adwords-sandbox.google.com/ and see if that works....

hakin

unread,
Mar 6, 2012, 3:44:09 PM3/6/12
to adwor...@googlegroups.com
That's not the problem :( I am still getting the same error. Here is the code.

<?php
 
error_reporting(E_STRICT | E_ALL);

// Add the library to the include path. This is not neccessary if you've already
// done so in your php.ini file.
$path = dirname(__FILE__) . '/../../../src';
set_include_path(get_include_path() . PATH_SEPARATOR . $path);

require_once 'Google/Api/Ads/AdWords/Lib/AdWordsUser.php'; 


$username = "***@gmail.com";
$password = "***";
$currencyCode = "TRY";
$developerToken = "$username++$currencyCode";
 
$user = new AdWordsUser(null, $username, $password, $developerToken);
$user->SetDefaultServer("https://adwords-sandbox.google.com");
$user->LogAll();
$user->SetClientId(null);
 
try {
    $campaignService = $user->GetService("CampaignService", 'v201109');
    $page = $campaignService->get(new Selector());
} catch (Exception $e) {}
 
$accountService = $user->GetService("ServicedAccountService", 'v201109');
$selector = new ServicedAccountSelector();
$page = $accountService->get($selector);
 
foreach ($page->accounts as $account) {
    print "Customer ID: {$account->customerId}\n";
}
 
$accountService = $user->GetService("ServicedAccountService", 'v201109');
$selector = new ServicedAccountSelector();
$page = $accountService->get($selector);
 
$customerId = $page->accounts[0]->customerId;
$user->SetClientId($customerId);
 
$campaignService = $user->GetService("CampaignService", 'v201109');
 
$campaign = new Campaign();
$campaign->name = "Test Sandbox Account";
$campaign->status = "ACTIVE";
$campaign->biddingStrategy = new ManualCPC();
 
$budget = new Budget();
$budget->period = 'DAILY';
$budget->amount = new Money((float) 10000000);
$budget->deliveryMethod = 'STANDARD';
$campaign->budget = $budget;
 
$networkSetting = new NetworkSetting();
$networkSetting->targetGoogleSearch = TRUE;
$campaign->networkSetting = $networkSetting;
 
$operation = new CampaignOperation();
$operation->operand = $campaign;
$operation->operator = 'ADD';
 
$operations = array($operation);
$result = $campaignService->mutate($operations);
 
print_r($result);
?>

Eric Koleda

unread,
Mar 12, 2012, 11:01:29 AM3/12/12
to adwor...@googlegroups.com
Hi,

Can you ensure that the URL is accessible from your server?  Perhaps there is a firewall in your network preventing the traffic.

Best,
- Eric

hakin

unread,
Mar 12, 2012, 11:28:13 AM3/12/12
to adwor...@googlegroups.com
Hi Eric. Thanks for the reply.

I am using WAMP and I tried to access above url using Chrome. it redirects me to www.google.com


BTW I tried it again with my MCC account and here is the error I got.

 Fatal error: Uncaught SoapFault exception: [soap:Server] InternalApiError.UNEXPECTED_INTERNAL_API_ERROR @ com.google.ads.api.services.common.error.InternalApiError.(InternalApiErro in C:\wamp\www\google\src\Google\Api\Ads\Common\Lib\AdsSoapClient.php:201 Stack trace: #0 C:\wamp\www\google\src\Google\Api\Ads\Common\Lib\AdsSoapClient.php(201): SoapClient->__soapCall('get', Array, NULL, Array, Array) #1 C:\wamp\www\google\src\Google\Api\Ads\AdWords\v201109\ServicedAccountService.php(1874): AdsSoapClient->__soapCall('get', Array) #2 C:\wamp\www\google\examples\v201109\AccountManagement\test.php(29): ServicedAccountService->get(Object(ServicedAccountSelector)) #3 {main} thrown in C:\wamp\www\google\src\Google\Api\Ads\Common\Lib\AdsSoapClient.php on line 201 


I am testing Ewan Heming's code...

hakin

unread,
Mar 12, 2012, 4:43:26 PM3/12/12
to adwor...@googlegroups.com
Wow it worked now. Thanks

Anash P. Oommen

unread,
Dec 10, 2012, 2:19:37 AM12/10/12
to adwor...@googlegroups.com
Hi,

The latest version of Adwords API is v201209. If you can point me to the part in documentation where v201109 is mentioned as the latest version, I'll get it fixed.

Cheers,
Anash P. Oommen,
AdWords API Advisor.

On Friday, 7 December 2012 23:56:54 UTC+5:30, hardik wrote:
I am facing the same problem as well ... How did you solve it ... Right now the api version available is v201209. I read that whenever there is a new api released the older one gets defunct in 4 months. At the same time the official client libraries at https://developers.google.com/adwords/api/docs/clientlibraries shows the v201109 to be the latest for PHP. Whichversion should I be using for PHP ?

On Thursday, December 6, 2012 10:33:34 PM UTC-8, Coder wrote:
hi Hakin, How did you solve it?  I'm also getting same error?

Jiwan Ghosal

unread,
Mar 18, 2015, 9:13:06 AM3/18/15
to adwor...@googlegroups.com, halil...@rocket-internet.com.tr
hakin,

I am also  get the same error .
is it required to give billing details in test account...??

 Thanks & Rgards
Jiwan Ghosal 

Danial Klimkin

unread,
Mar 18, 2015, 11:10:11 AM3/18/15
to adwor...@googlegroups.com, halil...@rocket-internet.com.tr
Hello Jiwan,


This thread is from 2012. Sandbox was deprecated long time ago.

Please create a new thread with details of your current problem.


-Danial, AdWords API Team.
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages