Ad Id of removed ads

33 views
Skip to first unread message

Eshwar Chettri

unread,
Mar 14, 2017, 11:12:18 AM3/14/17
to AdWords API Forum
Hi,
   can we get the ad ids of both existing and removed ads using AdGroupAdService?
I tried this but unable to get Ids of removed ads.
                Predicate idsPredicate = new Predicate();
                idsPredicate.setField("AdGroupId");
                idsPredicate.setOperator(PredicateOperator.IN);
                idsPredicate.setValues(new String[]{String.valueOf(gleAdGrpId)});
            Predicate idsPredicate1 = new Predicate();
            idsPredicate1.setField("Status");
            idsPredicate1.setOperator(PredicateOperator.IN);
            idsPredicate1.setValues(new String[]{"ENABLED", "PAUSED", "REMOVED"});
            selector.setFields(new String[]{"Id", "Status"});
            selector.setPredicates(new Predicate[]{idsPredicate, idsPredicate1});
            selector.setFields(selectedFields);


thanks,
Eshwar.


Vishal Vinayak (Adwords API Team)

unread,
Mar 14, 2017, 4:50:18 PM3/14/17
to AdWords API Forum
Hi Eshwar,

Could you please check via AdWords web interface if the ad group has deleted ads? If you plan to retrieve removed ads for all ad groups, could you please remove the first predicate from your selector and retry? If that doesn't help, could you please provide me with the SOAP XML request and response logs so that I can look into this issue further? 

Regards,
Vishal, AdWords API Team
Message has been deleted

Eshwar Chettri

unread,
Mar 14, 2017, 11:55:37 PM3/14/17
to AdWords API Forum
Hi Vishal,
I want the adcopy id of both exciting and removed ads of one selected ad group.

Thank you,
Eshwar.

Eshwar Chettri

unread,
Mar 15, 2017, 1:14:44 AM3/15/17
to AdWords API Forum
Error what I'am getting is
 faultSubcode: 
 faultString: [SelectorError.INVALID_PREDICATE_ENUM_VALUE @ serviceSelector; trigger:'REMOVED']
 faultActor: 
 faultNode: 
 faultDetail: 
{https://adwords.google.com/api/adwords/cm/v201605}ApiExceptionFault:<message>[SelectorError.INVALID_PREDICATE_ENUM_VALUE @ serviceSelector; trigger:'REMOVED']</message><ApplicationException.Type>ApiException</ApplicationException.Type><errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="SelectorError"><fieldPath>serviceSelector</fieldPath><trigger>REMOVED</trigger><errorString>SelectorError.INVALID_PREDICATE_ENUM_VALUE</errorString><ApiError.Type>SelectorError</ApiError.Type><reason>INVALID_PREDICATE_ENUM_VALUE</reason></errors>

[SelectorError.INVALID_PREDICATE_ENUM_VALUE @ serviceSelector; trigger:'REMOVED']
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at java.lang.Class.newInstance(Class.java:442)
at org.apache.axis.encoding.ser.BeanDeserializer.<init>(BeanDeserializer.java:104)
at org.apache.axis.encoding.ser.BeanDeserializer.<init>(BeanDeserializer.java:90)
at com.google.api.ads.adwords.axis.v201605.cm.ApiException.getDeserializer(ApiException.java:142)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)

Vishal Vinayak (Adwords API Team)

unread,
Mar 15, 2017, 10:46:26 AM3/15/17
to AdWords API Forum
Hi Eshwar,

Please refer to this document for valid set of values for an ad status. Could you please try filtering on the ad group using these values for ad status and check if you are still facing issues? You can also use this example available in our Java client library to retrieve ads available in an ad group. Please comment this line in case you have other ad types available in your ad group. Same example is available in other client libraries as well. Please revert if you have additional questions or concerns.
Reply all
Reply to author
Forward
0 new messages