Hi,
Im trying to change Campaignstatus.
But i always get the Error:
[OperatorError.OPERATOR_NOT_SUPPORTED @ operations[0]]
This is how I do it:
Does someone know what I am doing wrong here?
var client = new CampaignService.CampaignService();
//create Campaign with Status
Campaign campaign = new Campaign();
campaign.id = CurrentCampaignId;
switch (index)
{
case 0:
campaign.status=CampaignStatus.ENABLED;
break;
case 1:
campaign.status=CampaignStatus.PAUSED;
break;
case 2:
campaign.status=CampaignStatus.REMOVED;
break;
}
//Create the Operation
CampaignOperation operation = new CampaignOperation();
operation.operand = campaign;
operation.operatorSpecified = true;
operation.@operator= Operator.REMOVE;
try
{
client.PreAuthenticate = true;
client.UseDefaultCredentials = true;
client.RequestHeader = new SoapHeader
{
clientCustomerId = clientCustomerId,
developerToken = "XXXXXXXXXXXXXXXXXXXXX",
partialFailure = false,
userAgent = "AdWordsChangeStatus",
validateOnly = false,
};
client.PreAuthenticate = true;
CampaignReturnValue returnValue = client.mutate(new
CampaignOperation[] {operation});
if (returnValue != null && returnValue.value != null &&
returnValue.value.Length > 0)
{
Campaign changedCampaign = returnValue.value[0];
}
else
{
Console.WriteLine("No status has changed");
}
}
catch (Exception ex)
{
throw new System.ApplicationException("Failed to change
status", ex);
}
Thank you very much
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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].
Visit this group at http://groups.google.com/group/adwords-api.
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/47e3799a-016e-4127-9014-8e623d2ede7c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.