Hi,

I've now fixed the problem, though I don't quite understand it...!
Using the above code generates a SOAP request that contains the
dissaprovalReasons set to the id number of the ad. This code, i.e.
initilizing and adwords4r object first, doesn't, and thus works:

ad_operand = @adwords_adservice_srv.module::TextAd.new
                ad_operand.id = self.adwords_id
                adservice_data = {
                        :ad => ad_operand,
                        :adGroupId => self.adwords_adgroup_id,
                        :status => "#{self.status.upcase}"

                }

Odd. Thanks again,

Dan

On Nov 6, 9:43 am, Dan Hill <[email protected]> wrote:
> Hi Eric,
>
> Many thanks for the reply. I'd thought that originally, but that
> simply give me a
>
> ReadOnlyError.READ_ONLY @ operations[0].operand.ad.disapprovalReasons
>
> I'm not trying to set or update the disapprovalReasons at all? Even if
> I deliberately set it to null it still returns the same error.
>
> Thanks again,
>
> Dan
>
> On Nov 5, 11:19 pm, AdWords API Advisor <[email protected]>
> wrote:
>
> > Hi Dan,
>
> > I believe the problem is that your adservice_data object is not
> > structured correctly.  This object represents an AdGroupAd, which
> > doesn't have an "id" field ( 
> > seehttp://code.google.com/apis/adwords/v2009/docs/reference/AdGroupAdSer...
> > ).  Instead, there is an "ad" field holds an Ad, which in turn has the
> > "id" field.  Your object should probably look like:
>
> > adservice_data = {
> >         :ad => {
> >                 :id => self.adwords_id
> >         }
> >         :adGroupId => self.adwords_adgroup_id,
> >         :status => "#{self.status.upcase}"
>
> > }
>
> > Best,
> > - Eric Koleda, AdWords API Team
>
> > On Nov 5, 11:37 am, Dan Hill <[email protected]> wrote:
>
> > > Hi all,
>
> > > I'm developing a tool using Ruby Rails and Adwords4r. All is going
> > > great, apart from I keep getting an
> > > InternalApiError.UNEXPECTED_INTERNAL_API_ERROR every time I try and
> > > SET mutate an AdGroupAd (a text ad). I can create the ad fine, but
> > > whenever I try and update its status it gives me this error. I know I
> > > can't change the ad itself, but I only want to pause/enable the add,
> > > not change anything else. The code I'm using is:
>
> > > load_credentials
>
> > > adservice_data = {
> > >         :id => self.adwords_id,
> > >         :adGroupId => self.adwords_adgroup_id,
> > >         :status => "#{self.status.upcase}"
>
> > > }
>
> > > operation = {
> > >         :operand => adservice_data,
> > >          :operator => 'SET'
> > >          }
> > > response = @adwords_adservice_srv.mutate([operation])
>
> > > Anyone have any tips?
>
> > > Many thanks,
>
> > > Dan

--

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.


Reply via email to