Hi Guys,

I am using below code to pause ad copy, but it is not working for me,
it throws exception "An API exception has occurred. See ApiException
and InnerException fields for more details."

Is there anybody who can help.

AdGroupAdService service =
(AdGroupAdService)user.GetService(AdWordsService.v200909.AdGroupAdService);

            long adGroupId = long.Parse(adgId);
            long adId = long.Parse(strAdId);

            AdGroupAd adGroupAd = new AdGroupAd();

            adGroupAd.status = AdGroupAdStatus.PAUSED;
            adGroupAd.adGroupIdSpecified = true;
            adGroupAd.adGroupId = adGroupId;
            adGroupAd.ad = new TextAd();
            adGroupAd.ad.approvalStatusSpecified = false;
            adGroupAd.ad.id = adId;

            AdGroupAdOperation adGroupAdOperation = new
AdGroupAdOperation();
            adGroupAdOperation.operatorSpecified = true;
            adGroupAdOperation.@operator = Operator.REMOVE;
            adGroupAdOperation.operand = adGroupAd;
            try
            {
                AdGroupAdReturnValue retVal = null;
                retVal = service.mutate(new AdGroupAdOperation[]
{ adGroupAdOperation });
                if (retVal.value != null && retVal.value.Length > 0)
                {
                    AdGroupAd tempAdGroupAd = retVal.value[0];
                    MessageBox.Show(tempAdGroupAd.ad.id
+""+tempAdGroupAd.status);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

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

Reply via email to