Hi Guys,
Language: PHP
I'm trying to pull a list of AdSchedule IDs for a particular campaign. I've
mostly changed the code around from the GetCampaigns.php example and have
come up with the following. It doesn't work and I was wondering what I was
doing wrong.
function adsched(AdWordsUser $user, $campaignId){
$campaignCriterionService = $user->GetService('CampaignCriterionService',
ADWORDS_VERSION);
// Create selector.
$selector = new Selector();
$selector->fields = array('Id',);
$selector->predicates[] = new Predicate('CampaignId', 'IN',
array($campaignId));
$selector->paging = new Paging(0,
AdWordsConstants::RECOMMENDED_PAGE_SIZE);
do {
// Make the get request.
$page = $campaignCriterionService->get($selector);
// Display results.
if (isset($page->entries)) {
foreach ($page->entries as $schedule) {
printf("ID: " . $schedule->id . "\n");
}
} else {
print "No AdSchedules were found.\n";
}
// Advance the paging index.
$selector->paging->startIndex +=
AdWordsConstants::RECOMMENDED_PAGE_SIZE;
} while ($page->totalNumEntries > $selector->paging->startIndex);
}
Any help appreciated, thanks
Visar
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 [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
---
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 [email protected].
For more options, visit https://groups.google.com/d/optout.