try {
            require_once dirname(dirname(__FILE__)) . '/Google/init.php';

  $user = new AdWordsUser();
  $user->LogAll();


  // Get the service, which loads the required classes.
  $campaignService = $user->GetService('CampaignService', ADWORDS_VERSION);

  // Create selector.
  $selector = new Selector();
  $selector->fields = array('Id', 'Name', 'Labels');
  // Labels filtering is performed by ID. You can use containsAny to select
  // campaigns with any of the label IDs, containsAll to select campaigns 
with
  // all of the label IDs, or containsNone to select campaigns with none of 
the
  // label IDs.
  $selector->predicates[] = new Predicate('Labels', 'CONTAINS_ANY',
      array($labelId));
  $selector->ordering[] = new OrderBy('Name', 'ASCENDING');

  // Create paging controls.
  $selector->paging = new Paging(0, 
AdWordsConstants::RECOMMENDED_PAGE_SIZE);

  do {
    // Make the get request.
    $page = $campaignService->get($selector);

    // Display results.
    if (isset($page->entries)) {
      foreach ($page->entries as $campaign) {
        printf("Campaign with name '%s' and ID '%d' and labels '%s'" .
            " was found.\n", $campaign->name, $campaign->id,
            implode(', ',
                array_map(function($label) {
                  return sprintf('%d/%s', $label->id, $label->name);
                }, $campaign->labels)));
      }
    } else {
      print "No campaigns were found.\n";
    }

    // Advance the paging index.
    $selector->paging->startIndex += 
AdWordsConstants::RECOMMENDED_PAGE_SIZE;
  } while ($page->totalNumEntries > $selector->paging->startIndex);








    } catch (Exception $e) {
            printf("An error has occurred:".$e->getLine()." %s\n", 
$e->getMessage() );
// echo '<pre>';
// print_r($return_array);
// echo '</pre>';
//         exit;
        }




W dniu środa, 5 października 2016 21:02:26 UTC+2 użytkownik Anthony 
Madrigal napisał:
>
> Hello,
>
> Could you please provide me with the report definition or report query you 
> used that resulted in this error? Please do so using *reply privately to 
> author.*
>
> Thanks,
> Anthony
> AdWords API Team
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

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-api@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
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/9a8d328d-bd1d-4f1e-99a6-9f565429f9d4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • PHP ... testapidilren2
    • ... 'Shwetha Vastrad (AdWords API Team)' via AdWords API Forum
      • ... testapidilren2
        • ... 'Anthony Madrigal' via AdWords API Forum
          • ... testapidilren2
    • ... testapidilren2
      • ... 'Thanet Knack Praneenararat (AdWords API Team)' via AdWords API Forum
        • ... testapidilren2
          • ... 'Thanet Knack Praneenararat (AdWords API Team)' via AdWords API Forum

Reply via email to