Remove keyword error

145 views
Skip to first unread message

Emanuele Sacco

unread,
Aug 3, 2016, 9:18:41 AM8/3/16
to AdWords API Forum
Hi all,

I have a problem with the adwords api for python using googleads for python.
I'm trying to execute the operator REMOVE on a keyword in this way:


...
ad_group_criterion_service = client.GetService(
        'AdGroupCriterionService', version='v201607')

    # Construct operations and delete ad group criteria.
    operations = [
        {
            'operator': 'REMOVE',
            'operand': {
                'xsi_type': 'BiddableAdGroupCriterion',
                'adGroupId': ad_group_id,
                'criterion': {
                    'id': criterion_id
                }
            }
        }
    ]
    result = ad_group_criterion_service.mutate(operations)
...

and an error occurred:


ERROR:suds.client:<suds.sax.document.Document object at 0x7f1c93737ac8>
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/suds/transport/http.py", line 82, in send
    fp = self.u2open(u2request)
  File "/usr/local/lib/python3.5/dist-packages/suds/transport/http.py", line 132, in u2open
    return url.open(u2request, timeout=tm)
  File "/usr/lib/python3.5/urllib/request.py", line 472, in open
    response = meth(req, response)
  File "/usr/lib/python3.5/urllib/request.py", line 582, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python3.5/urllib/request.py", line 510, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.5/urllib/request.py", line 444, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.5/urllib/request.py", line 590, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 500: Internal Server Error

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/suds/client.py", line 613, in send
    reply = self.options.transport.send(request)
  File "/usr/local/lib/python3.5/dist-packages/suds/transport/http.py", line 94, in send
    raise TransportError(e.msg, e.code, e.fp)
suds.transport.TransportError: Internal Server Error

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "remove_keywords.py", line 35, in <module>
    main(_adwords.adwords_client, AD_GROUP_ID, CRITERION_ID)
  File "remove_keywords.py", line 25, in main
    result = ad_group_criterion_service.mutate(operations)
  File "/usr/local/lib/python3.5/dist-packages/googleads/common.py", line 617, in MakeSoapRequest
    for arg in args])
  File "/usr/local/lib/python3.5/dist-packages/suds/client.py", line 521, in __call__
    return client.invoke(args, kwargs)
  File "/usr/local/lib/python3.5/dist-packages/suds/client.py", line 581, in invoke
    result = self.send(soapenv)
  File "/usr/local/lib/python3.5/dist-packages/suds/client.py", line 619, in send
    description=tostr(e), original_soapenv=original_soapenv)
  File "/usr/local/lib/python3.5/dist-packages/suds/client.py", line 670, in process_reply
    raise WebFault(fault, replyroot)
suds.WebFault: Server raised fault: '[OperationAccessDenied.ACTION_NOT_PERMITTED @ class com.google.ads.api.serviceimpls.campaignmgmt.criterion.adgroupcriterion.Mu]'


How can I solve this?

Many thanks

Emanuele Sacco

Shwetha Vastrad (AdWords API Team)

unread,
Aug 3, 2016, 2:00:49 PM8/3/16
to AdWords API Forum
Hi Emanuele Sacco,

The ACTION_NOT_PERMITTED error occurs during the unauthorized invocation of the method. Have you tried using the remove_keyword example from the python client library? Can you enable logging and provide the SOAP XML request and response logs generated and also provide the email address used to authorize the request? Please use Reply privately to author when responding.

Thanks,
Shwetha, AdWords API Team.
Reply all
Reply to author
Forward
0 new messages