Reading removed ads using API

51 views
Skip to first unread message

Denis Terletskiy

unread,
Jul 14, 2015, 11:06:41 AM7/14/15
to adwor...@googlegroups.com
Hi!

I would like to restore (recreate) some removed Image Ads because during adding them I had got exception NullError.NULL_CONTENT for ad.image.data field. I have removed ads Ids, AdGroupIds. Is it possible to read that ads via API, or, at least, Images of those ads so I can create new ads?

Thank you!

Kind regards,
Denis

P.S. I have already posted similar question, but have not found it in the list. Probably I lost it somehow. In case you saw it, sorry for the second attempt

Danial Klimkin

unread,
Jul 15, 2015, 10:04:26 AM7/15/15
to adwor...@googlegroups.com, terle...@gmail.com
Hello Denis,


Yes, you can retrieve delete ads provided they had non-zero stats. For that, you need to explicitly specify a predicate of status = REMOVED in your get request.

Ads with zero stats are completely deleted on removal and can no longer be obtained.


-Danial, AdWords API Team.

Denis Terletskiy

unread,
Jul 15, 2015, 11:56:00 AM7/15/15
to adwor...@googlegroups.com, terle...@gmail.com
Hello Danial,

I have tried that but it throws the following exception: {"[SelectorError.INVALID_PREDICATE_ENUM_VALUE @ serviceSelector; trigger:'REMOVED']"}

Here is the piece of code:

                var service = (AdGroupAdService)user.GetService(
                    AdWordsService.v201502.AdGroupAdService);

                var selector = new Selector
                {
                    fields = new[] { "AdGroupId", "Id", "Url" },
                    predicates = new[]
                        { 
                            new Predicate
                            {
                                field = "Status",
                                @operator = PredicateOperator.IN,
                                values = new []{ "REMOVED" }
                            },
                            //new Predicate
                            //{
                            //    field = "Id",
                            //    @operator = PredicateOperator.IN,
                            //    values = adDatas.Select(a => a.Id.ToString()).ToArray()
                            //}
                        }                    
                };
                
                page = service.get(selector);

Danial Klimkin

unread,
Jul 16, 2015, 11:19:22 AM7/16/15
to adwor...@googlegroups.com, terle...@gmail.com
Hello Denis,


Sorry, the value is still "DISABLED" for ads. Please always refer to the documentation for precise enum values:



-Danial, AdWords API Team.
Reply all
Reply to author
Forward
0 new messages