can't disable an ImageAd (mediaId required?)

255 views
Skip to first unread message

BeeGeez

unread,
Apr 21, 2010, 3:31:02 PM4/21/10
to AdWords API Forum
I am trying the update and ImageAd by just setting the status to
DISABLED. Unfortunately, I get the following error:
[RequiredError.REQUIRED @ operations[0].operand.ad.image.mediaId]

The mediaId is always 0 for all my image ads. Even if I
set .mediaIdSpecified to True, I get a different error:
[RangeError.TOO_LOW @ operations[0].operand.ad.image.mediaId.id]

Even the documentation doesn't make sense. It says this field is
required but it's optional:
"Media id; Optional; E.g., image ads don't have a mediaId. This field
is required and should not be null when it is contained within
Operators : SET, REMOVE."

Since image ads don't have a mediaId, why is it required? And how can
I update an ImageAd if my mediaId is always 0?

--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Have you migrated to v200909 yet?
The v13 sunset is on April 22, 2010.

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 adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

AdWords API Advisor

unread,
Apr 22, 2010, 11:26:41 AM4/22/10
to AdWords API Forum
Hi,

When updating an AdGroupAd ensure that the ad field contains a generic
Ad object. This allows you to only set the id and not the other
fields.

Best,
- Eric Koleda, AdWords API Team

On Apr 21, 3:31 pm, BeeGeez <brianpgra...@gmail.com> wrote:
> I am trying the update and ImageAd by just setting the status to
> DISABLED.  Unfortunately, I get the following error:
> [RequiredError.REQUIRED @ operations[0].operand.ad.image.mediaId]
>
> The mediaId is always 0 for all my image ads.  Even if I
> set .mediaIdSpecified to True, I get a different error:
> [RangeError.TOO_LOW @ operations[0].operand.ad.image.mediaId.id]
>
> Even the documentation doesn't make sense.  It says this field is
> required but it's optional:
> "Media id; Optional; E.g., image ads don't have a mediaId. This field
> is required and should not be null when it is contained within
> Operators : SET, REMOVE."
>
> Since image ads don't have a mediaId, why is it required?  And how can
> I update an ImageAd if my mediaId is always 0?
>
> --
> =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
> Have you migrated to v200909 yet?
> The v13 sunset is on April 22, 2010.
>
> Also find us on our blog and discussion group:http://adwordsapi.blogspot.comhttp://groups.google.com/group/adwords-api

jellegaa

unread,
Sep 17, 2011, 8:32:25 AM9/17/11
to adwor...@googlegroups.com, adwordsa...@google.com
I'm having about the same problem now, while creating an image ad, and I do not understand your reply.
Trying to create an image ad requires a mediaId, and zero is not accepted. Then I try using the ad-id, that is accepted. But what is a mediaId for an image? The documentation is of no help at all!

Thanks
Jesper

jellegaa

unread,
Sep 18, 2011, 7:55:01 AM9/18/11
to adwor...@googlegroups.com, adwordsa...@google.com
To clarify a bit:
Actually I'm getting an existing image ad, alter the url, downloading and applying the image, and then creating at new one.
When getting the image ad, the mediaId is unset
/J 

Kevin Winter

unread,
Sep 19, 2011, 2:47:04 PM9/19/11
to adwor...@googlegroups.com, adwordsa...@google.com
Hi,
  What Eric meant was that you should only provide an Ad object (http://code.google.com/apis/adwords/docs/reference/latest/AdGroupAdService.Ad.html) in the Ad field of the AdGroupAd object.  If the Ad feed of the AdGroupAd is populated with a specific type of Ad (as it is when you retrieve it), the required portions of the ImagedAd are causing this issue.  Try removing the non-Ad fields and changing the xsi:type to Ad.

- Kevin Winter
AdWords API Team
Reply all
Reply to author
Forward
0 new messages