$email = "MCC a/c email";
$password = "MCC a/c pwd";
$useragent = "Ipsita Test Sample";
$applicationToken = "app token";//Ignored in Sandbox
$account_type = "GOOGLE";
$service = "adwords";
$clientEmail = "$email";
$namespace = 'https://adwords.google.com/api/adwords/v13';
$developerToken = 'dev token';
$clientEmails =
array("array of emails get through
$account_service = SoapClientFactory::GetClient($namespace . '/
AccountService?wsdl', 'wsdl');
$account_service->setHeaders($headers);
$debug = 0;
//$login_emails = $account_service->call('getClientAccounts');
//$login_emails = $login_emails['getClientAccountsReturn'];
$login_emails = $account_service->call('getClientAccountInfos');
$login_emails = $login_emails['getClientAccountInfosReturn'];
");
$clientEmailsXml = '';
foreach($clientEmails as $clientEmail) {
$clientEmailsXml .=
"<clientEmails>" . trim($clientEmail) . "</clientEmails>";
}
# Define SOAP headers.
$headers =
'<email>'.$email.'</email>'.
'<password>'.$password.'</password>'.
'<clientEmail>'.$clientEmail.'</clientEmail>'.
'<useragent>'.$useragent.'</useragent>'.
'<developerToken>'.$developerToken.'</developerToken>'.
'<applicationToken>'.$applicationToken.'</applicationToken>';
$report_service = SoapClientFactory::GetClient($namespace . '/
ReportService?wsdl', 'wsdl');
$report_service->setHeaders($headers);
$report_job =
'<selectedReportType>Campaign</selectedReportType>'.
'<name>Sample Keyword Report</name>'.
'<crossClient>true</crossClient>'.
$clientEmailsXml.
'<aggregationTypes>Daily</aggregationTypes>'.
'<adWordsType>ContentOnly</adWordsType>'.
'<keywordType>Broad</keywordType>'.
'<startDay>2004-06-20</startDay>'.
'<endDay>2037-12-30</endDay>'.
'<selectedColumns>Impressions</selectedColumns>'.
'<selectedColumns>Clicks</selectedColumns>'.
'<selectedColumns>CTR</selectedColumns>'.
'<selectedColumns>CPC</selectedColumns>';
$request_xml =
'<validateReportJob>'.
'<job xmlns:impl="https://adwords.google.com/api/adwords/v13" '.
'xsi:type="impl:DefinedReportJob">'.$report_job.'</job>'.
'</validateReportJob>';
# Validate report.
$report_service->call('validateReportJob', $request_xml);
print '<pre>';print_r($report_service);exit;
In the response array one statement i got
[document] =>
soapenv:Server.userException
You must supply an MCC login to perform the current operation.
61
You must supply an MCC login to perform the current operation.
crossClient
Can anyone please help me to get rid of this problem?
At least help me to set the $report_job
--
You received this message because you are subscribed to the Google Groups
"AdWords API Forum" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en.