title: How can I tell the Google Adwords API which client/account in my MCC I am querying?
body: <p>Using the latest PHP CLient Library (v2.6.3) I can't seem to figure out to get all campaigns for a client in my MCC (my client center) account.</p>
  
  <p>I can easily get all accounts via:</p>
  
  <pre><code>$user = new AdWordsUser(NULL, $email, $password, $devToken, $applicationToken, $userAgent, NULL, $settingsFile);
  
  $service = $user-&gt;GetServicedAccountService();
  $selector = new ServicedAccountSelector();
  $selector-&gt;enablePaging = false;
  
  $graph = $service-&gt;get($selector);
  $accounts = $graph-&gt;accounts; // all accounts!
  </code></pre>
  
  <p>Now that I've done that, I want to get all the campaigns within each account. Running the code as documented <a href="http://code.google.com/p/google-api-adwords-php/source/browse/trunk/examples/v201101/GetAllCampaigns.php" rel="nofollow">here</a> doesn't work.</p>
  
  <pre><code>// Get the CampaignService.
  // ** Different than example because example calls a private method ** //
  $campaignService = $user-&gt;GetCampaignService('v201101');
  
  // Create selector.
  $selector = new Selector();
  $selector-&gt;fields = array('Id', 'Name');
  $selector-&gt;ordering = array(new OrderBy('Name', 'ASCENDING'));
  
  // Get all campaigns.
  $page = $campaignService-&gt;get($selector);
  
  // Display campaigns.
  if (isset($page-&gt;entries)) {
      foreach ($page-&gt;entries as $campaign) {
          print 'Campaign with name "' . $campaign-&gt;name . '" and id "'
              . $campaign-&gt;id . "\" was found.\n";
      }
  }
  </code></pre>
  
  <p>All the above code will do is throw an error:</p>
  
  <blockquote>
    <p>Fatal error: Uncaught SoapFault exception: [soap:Server]
    QuotaCheckError.INVALID_TOKEN_HEADER @ message=null
    stack=com.google.ads.api.authserver.common.AuthException at
    com.go;</p>
  </blockquote>
  
  <p>I have a feeling that the reason this fails is that GetCampaignService needs an account's id...but I can't figure out how to specify this id.</p>
  
  <p>What am I doing wrong?</p>