title: multiple report download php adwords api
body: <p>Iam trying to download a reports for various sub-accounts under an MCC account. I am setting the clientCustomerId from within my code since I would want to loop through the various clientCustomerIds to have all the reports downloaded in one run. So far I have been testing it with one clientCustomerId but I get the following error: </p>
  
  <p>An error has occurred: The client customer ID must be specified for report downloads.</p>
  
  <p>I have no idea where I am going wrong. I am using AdWords API v201406:</p>
  
  <p>Here is the code:</p>
  
  <pre><code>&lt;?php
  require_once dirname(dirname(__FILE__)) . '/init.php';
  require_once ADWORDS_UTIL_PATH . '/ReportUtils.php';
  
  /**
   * Runs the example.
   * @param AdWordsUser $user the user to run the example with
   * @param string $filePath the path of the file to download the report to
   */
  function KeywordPerformanceReport(AdWordsUser $user, $filePath) {
    // Load the service, so that the required classes are available.
    $user-&gt;LoadService('ReportDefinitionService', ADWORDS_VERSION);
  
    // Create selector.
    $selector = new Selector();
    $selector-&gt;fields = array('AccountDescriptiveName', 'CampaignId', 'CampaignName', 'CampaignStatus', 'AdGroupId', 'AdGroupName', 'AdGroupStatus',
        'AverageCpc', 'AveragePageviews', 'AverageTimeOnSite', 'Id', 'Impressions', 'KeywordText', 'Clicks', 'PlacementUrl', 'TrackingUrlTemplate', 'ConversionRate', 'Conversions', 'Cost', 'Date', 'DayOfWeek', 'DestinationUrl');
  
    // Filter out removed criteria.
    $selector-&gt;predicates[] = new Predicate('Status', 'NOT_IN', array('REMOVED'));
  
    // Create report definition.
    $reportDefinition = new ReportDefinition();
    $reportDefinition-&gt;selector = $selector;
    $reportDefinition-&gt;reportName = 'Keyword performance report #' . time();
    $reportDefinition-&gt;dateRangeType = 'YESTERDAY';
    $reportDefinition-&gt;reportType = 'KEYWORDS_PERFORMANCE_REPORT';
    $reportDefinition-&gt;downloadFormat = 'CSV';
  
    // Exclude criteria that haven't recieved any impressions over the date range.
    $reportDefinition-&gt;includeZeroImpressions = FALSE;
  
    // Set additional options.
    $options = array('version' =&gt; ADWORDS_VERSION);
  
    // Download report.
    ReportUtils::DownloadReport($reportDefinition, $filePath, $user, $options);
  
    printf("Report with name '%s' was downloaded to '%s'.\n",
        $reportDefinition-&gt;reportName, $filePath);
  }
  
  // Don't run the example if the file is being included.
  if (__FILE__ != realpath($_SERVER['PHP_SELF'])) {
    return;
  }
  
  try {
    // Get AdWordsUser from credentials in "../auth.ini"
    // relative to the AdWordsUser.php file's directory.
  
    $user = new AdWordsUser();
    $customerId='xxx-xxx-xxx';
    $user-&gt;SetClientId($customerId);
  
    // Log every SOAP XML request and response.
    $user-&gt;LogAll();
  
    // Download the report to a file in the same directory as the example.
    $filePath = dirname(__FILE__) . '/report.csv';
  
    // Run the example.
    KeywordPerformanceReport($user, $filePath);
  } catch (Exception $e) {
    printf("An error has occurred: %s\n", $e-&gt;getMessage());
  }
  </code></pre>