Hi Eric Thanks for the response.But still my problem is remained unsolved. My objective is 1>I need to fetch all the campaigns of each clients of an MCC account 2>I need to make the report for each of the clients of that MCC account.
Now I concentrate to solve the 1st problem. I commented the <clientEmail></clientEmail> //'<clientEmail>'.$clientEmail.'</clientEmail>'. $login_emails = $account_service->call('getClientAccountInfos'); $login_emails = $login_emails['getClientAccountInfosReturn']; print_r($login_emails);//exit; it gave case1: Array ( [emailAddress] => "The real gmail id" [isCustomerManager] => true ) Then I tried to get all the campaigns of that client through the below code Notice: Uninitialized string offset: 0 in /var/www/html/adword_xml/ client_schedule_report.php on line 65 Case2: Next I uncommented <clientEmail>'.$clientEmail.'</clientEmail>' and entered the "The real gmail id" got from the above code in place of $clientEmail of '<clientEmail>'.$clientEmail.'</clientEmail>' and got approximately 30 real emailAddress whose [isCustomerManager] => false I think these 30 emailAddress are the emailAddress of the clients of my MCC acount.plz answer am I write? If yes,then can u plz help me to get all the campaigns under those emailAddress?Hope a positive answer. I tried myself and ran the below $campaign_service=SoapClientFactory::GetClient($namespace.'/ CampaignService?wsdl','wsdl'); $campaign_service->setHeaders($headers); $request_xml ='<getAllAdWordsCampaigns><dummy>0</dummy></ getAllAdWordsCampaigns>'; $campaigns = $campaign_service->call('getAllAdWordsCampaigns', $request_xml); $campaigns = $campaigns['getAllAdWordsCampaignsReturn']; print_r($campaigns);exit; i>by setting $headers = '<email>'.$email.'</email>'. '<password>'.$password.'</password>'. '<clientEmail>'.$clientEmail.'</clientEmail>'. '<useragent>'.$useragent.'</useragent>'. '<developerToken>'.$developerToken.'</developerToken>'. '<applicationToken>'.$applicationToken.'</applicationToken>'; and $clientEmail as the one which I get from case1: mentioned above It gave result as Notice: Uninitialized string offset: 0 Then I set one of the emailAddress out of the 30 emailAddress as $clientEmail but it gave the same Notice Notice: Uninitialized string offset: 0 What to do Eric?Plz help me. Because this time I am not using sanbox.I am using the real app_token,dev_tokem,email_id , passwd and $namespace = 'https://adwords.google.com/api/adwords/v13'; Hope for a quick response On Jan 23, 2:47 am, AdWords API Advisor <adwordsapiadvi...@google.com> wrote: > Hi, > > I believe the problem here is that you are running the report in the > sandbox. All statistics in the sandbox are fake and the report > service will always return an empty report. Try this request in > production and you should get back the correct data. > > Best, > - Eric Koleda, AdWords API Team > > On Jan 22, 8:12 am, ipsita rout <afixi.ips...@gmail.com> wrote: > > > > > I wrote the following code > > $sandbox = 1; > > # Provide AdWords login information.For security reason I have not given the > > Proper adword information.But in my code i used the proper information. > > $email = "MCC gmail"; > > $password = "MCC Gmail's password"; > > $useragent = "Ipsita Test Sample"; > > $applicationToken = "App Token"; > > $account_type = "GOOGLE"; > > $service = "adwords"; > > $clientEmail = "client_1+$email"; > > $namespace = 'https://sandbox.google.com/api/adwords/v13'; > > $developerToken = "$email++USD"; > > > # 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>'. > > '<clientEmails></clientEmails>'. > > '<aggregationTypes>Summary</aggregationTypes>'. > > '<adWordsType>ContentOnly</adWordsType>'. > > '<keywordType>Broad</keywordType>'. > > '<startDay>2007-12-01</startDay>'. > > '<endDay>2010-01-22</endDay>'. > > '<selectedColumns>Campaign</selectedColumns>'. > > '<selectedColumns>AdGroup</selectedColumns>'. > > '<selectedColumns>Keyword</selectedColumns>'. > > '<selectedColumns>KeywordStatus</selectedColumns>'. > > '<selectedColumns>KeywordMinCPC</selectedColumns>'. > > '<selectedColumns>KeywordDestUrlDisplay</selectedColumns>'. > > '<selectedColumns>Impressions</selectedColumns>'. > > '<selectedColumns>Clicks</selectedColumns>'. > > '<selectedColumns>CTR</selectedColumns>'. > > '<selectedColumns>AveragePosition</selectedColumns>'. > > '<campaigns>1</campaigns>'; > > $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; > > $request_xml = > > '<scheduleReportJob>'. > > '<job xmlns:impl="https://adwords.google.com/api/adwords/v13" '. > > 'xsi:type="impl:DefinedReportJob">'.$report_job.'</job>'. > > '</scheduleReportJob>'; > > $job_id = $report_service->call('scheduleReportJob', $request_xml); > > $job_id = $job_id['scheduleReportJobReturn']; > > //print '<pre>';print_r($job_id);exit; > > $request_xml = > > '<getReportJobStatus>'. > > '<reportJobId>'.$job_id.'</reportJobId>'. > > '</getReportJobStatus>'; > > $status = $report_service->call('getReportJobStatus', $request_xml); > > $status = $status['getReportJobStatusReturn']; > > //print '<pre>';print_r($status);exit; > > while ($status != 'Completed' and $status != 'Failed') { > > echo 'Report job status is "'.$status.'".'."\n"; > > sleep(30); > > $status = $report_service->call('getReportJobStatus', $request_xml); > > $status = $status['getReportJobStatusReturn']; > > > } > > > if ($status == 'Failed') { > > echo 'Report job generation failed.' . "\n"; > > return;} > > > # Download report. > > $request_xml = > > '<getGzipReportDownloadUrl>'. > > '<reportJobId>'.$job_id.'</reportJobId>'. > > '</getGzipReportDownloadUrl>'; > > > $report_url = $report_service->call('getGzipReportDownloadUrl', > > $request_xml); > > $report_url = $report_url['getGzipReportDownloadUrlReturn']; > > print '<pre>';print_r($report_url);exit; > > > The above code gives the below output: > > Report job status is "Pending". Report job status is "InProgress". Report > > job status is "InProgress". > > >https://sandbox.google.com/sandboxreports/defined.xml.gz > > > When I run the URL and download the file and then unzipped it.Then got > > the XML file,which has all values containig 0. > > > Again > > > When I tried to fetch all the campaigns of the clients under the MCC > > account.It gives error result. > > > Can any one please help me to make reports of the clients under an MCC > > account. > > > At least help me to fetch all the campaigns of the clients under an MCC. -- You received this message because you are subscribed to the Google Groups "AdWords API Forum" group. To post to this group, send email to adwords-...@googlegroups.com. To unsubscribe from this group, send email to adwords-api+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/adwords-api?hl=en.