Re: How to remove an ad schedule using id?

2018-02-26 Thread Ken Dan Tinio
Thanks been look for that! Works amazingly!

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/29dcf978-e7c7-4bac-a654-b9a95f67dfe8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to remove an ad schedule using id?

2018-02-23 Thread 'Dhanya Sundararaju (AdWords API Team)' via AdWords API Forum
Hi Ken,

I was able to get the status for adschedule via the code snippet below. 
Please note that CampaignCriterionStatus field needs to be specified 
explicility in your selector fields:

$campaignCriterionService =
$adWordsServices->get($session, CampaignCriterionService::class);

// Create a selector to select all campaign criteria for the specified 
campaign.
$selector = new Selector();
$selector->setFields(['Id', 'CriteriaType', '*CampaignCriterionStatus*']);
$selector->setPredicates([
new Predicate('CampaignId', PredicateOperator::IN, [$campaignId]),
new Predicate('CriteriaType', PredicateOperator::IN,['AD_SCHEDULE'])]);
$selector->setPaging(new Paging(0, self::PAGE_LIMIT));

$totalNumEntries = 0;
do {
// Retrieve campaign criteria one page at a time, continuing to request
// pages until all campaign criteria have been retrieved.
$page = $campaignCriterionService->get($selector);

// Print out some information for each campaign criterion.
if ($page->getEntries() !== null) {
$totalNumEntries = $page->getTotalNumEntries();
foreach ($page->getEntries() as $campaignCriterion) {
printf("Campaign targeting criterion with ID %d and type '%s' and status 
'%s' was found.\n",
$campaignCriterion->getCriterion()->getId(),
$campaignCriterion->getCriterion()->getType(),
*$campaignCriterion->getCampaignCriterionStatus())*;
}
}

Response I received was as below:

*[2018-02-23 11:30:21] AW_SOAP.INFO: clientCustomerId=***-***- 
operations=1 service=CampaignCriterionService method=get responseTime=164 
requestId=000565e3ad2dae7a0ae9eb585b0316b1 server=adwords.google.com 
isFault=0 faultMessage= Campaign targeting criterion with ID 350096 and 
type 'AD_SCHEDULE' and status 'ACTIVE' was found.*

If you still face issues, please reply back with your complete SOAP logs so 
that I will be able to troubleshoot further.

Regards,
Dhanya, 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/d43e7b58-0deb-494c-b332-4011ff0612ed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to remove an ad schedule using id?

2018-02-22 Thread Ken Dan Tinio

>
> The status is null..
>



  $data[] = array(
  "id"  => 
$campaignCriterion->getCriterion()->getId(),
  "type"=> 
$campaignCriterion->getCriterion()->getType(),
  "dayofweek"   => 
$campaignCriterion->getCriterion()->getDayOfWeek(),
  "starthour"   => $string_start_hour,
  "startminute" => $string_start_min,
  "endhour" => $string_end_hour,
  "endminute"   => $string_end_min,
  "campaign_id" => $campaignCriterion->getCampaignId(),
  "status"  => 
$campaignCriterion->getCampaignCriterionStatus(),
  "result"  => $dayofweek.", 
".$string_start_hour.':'.$string_start_min.' to 
'.$string_end_hour.':'.$string_end_min
  ); 




{
"id": 320096,
"type": "AD_SCHEDULE",
"dayofweek": "WEDNESDAY",
"starthour": "00",
"startminute": "00",
"endhour": 24,
"endminute": "00",
"campaign_id": 175483775,
"status": null,
"result": "Wednesday, 00:00 to 24:00"
},

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/14e9cfd7-317f-4fdf-ab8e-e9646e93248b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to remove an ad schedule using id?

2018-02-22 Thread 'Dhanya Sundararaju (AdWords API Team)' via AdWords API Forum
Hi Ken,

You can use the below code snippet to get the status of the criterion 

$campaignCriterion->getCampaignCriterionStatus();

Regards,
Dhanya, 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/67809b72-e98b-4a9b-aba7-e2a4c6fb41c3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to remove an ad schedule using id?

2018-02-21 Thread Ken Dan Tinio
How do I know if its removed status?


so far I have this code:

  $data[] = array(
  "id"  => 
$campaignCriterion->getCriterion()->getId(),
  "type"=> 
$campaignCriterion->getCriterion()->getType(),
  "dayofweek"   => 
$campaignCriterion->getCriterion()->getDayOfWeek(),
  "starthour"   => 
$campaignCriterion->getCriterion()->getStartHour(),
  "startminute" => 
$campaignCriterion->getCriterion()->getStartMinute(),
  "endhour" => 
$campaignCriterion->getCriterion()->getEndHour(),
  "endminute"   => 
$campaignCriterion->getCriterion()->getEndMinute(),
  "campaign_id" => $campaignCriterion->getCampaignId(),
  // "campaign_name"   => 
$campaignCriterion->getCampaign()->getName(),
  );

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/d039d9d3-20d6-49f3-bda1-b901e9315533%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to remove an ad schedule using id?

2018-02-20 Thread 'Dhanya Sundararaju (AdWords API Team)' via AdWords API Forum
Hi Ken,

The error OperationAccessDenied.OPERATION_NOT_PERMITTED_FOR_REMOVED_ENTITY, 
is usually thrown when you try to do a mutate operation on a entity that 
was already removed. Please refer guide 

 for 
better clarity. You could also get a EntityNotFound.INVALID_ID 

 error. 
Your code looks good to me and should remove the ad schedule using 
AdSchedule id, after the line 
$campaignCriterionService->mutate($removeOperations); is executed as in 
example here 
.
 
If this does not address your issue, could you please reply with your 
complete SOAP logs? You may opt to *reply privately to author*.

Regards,
Dhanya, 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/8729ba7b-6957-4707-b021-9e8f0de08604%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to remove an ad schedule using id?

2018-02-20 Thread Ken Dan Tinio

so far I have this code


$adsched = new AdSchedule();
$adsched->setId($ad_schedule_id);

// Create a criterion with modified bid.
$criterion = new CampaignCriterion();
$criterion->setCampaignId($campaign_id);
$criterion->setCriterion($adsched);

// Create a campaign criterion operation and add it to the operations 
list.
$operation = new CampaignCriterionOperation();
$operation->setOperator(Operator::REMOVE);
$operation->setOperand($criterion);
$operations = [$operation];


Then I get this error

[OperationAccessDenied.OPERATION_NOT_PERMITTED_FOR_REMOVED_ENTITY @ 
operations[0]]

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/ec46d12b-8688-4b3c-94b4-4572d78e7d01%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.