How to avoid OPERATION_NOT_PERMITTED_FOR_REMOVED_ENTITY

693 views
Skip to first unread message

Jose Luis Lopez Pino

unread,
Oct 22, 2014, 7:03:08 AM10/22/14
to adwor...@googlegroups.com
Hi,

I'm trying to update (remove and add) the ads of several adgroups, but frequently I get an OperationAccessDenied.OPERATION_NOT_PERMITTED_FOR_REMOVED_ENTITY error when I try to remove the old ads.
To try to avoid this, I'm including the following condition in all the selectors to ensure that I'm not retrieving removed adgroups or ads:
                {
                  'field': 'Status',
                  'operator': 'IN',
                  'values': ['ENABLED', 'PAUSED']
                }

However, the problem persists. Is there any other condition that I should add to the selector to avoid this error?

Thanks in advance,
Pino

Josh Radcliff (AdWords API Team)

unread,
Oct 23, 2014, 9:37:09 AM10/23/14
to adwor...@googlegroups.com
Hi Pino,

You're probably getting that error because the Campaign that contains the AdGroup of the AdGroupAd has been removed. Once a Campaign has been removed you can no longer mutate any attributes of its AdGroups.

To limit to AdGroups that are neither removed nor are in removed Campaigns, you can do the following:

1. Use CampaignService.get to select all Campaigns with Status = 'REMOVED', and store those Campaign IDs.

2. When selecting AdGroups via AdGroupService.get, include two predicates:

  a. Status IN ['ENABLED', 'PAUSED']

  b. CampaignId NOT_IN [ list of removed campaign IDs from step 1 ]

Cheers,
Josh, AdWords API Team

Charlie Muir

unread,
Nov 18, 2015, 8:40:57 AM11/18/15
to AdWords API Forum
What is CampaignService.get?

Josh Radcliff (AdWords API Team)

unread,
Nov 18, 2015, 10:16:30 AM11/18/15
to AdWords API Forum
Hi,

CampaignService.get refers to the get method of CampaignService, which you can use to retrieve your campaigns. Check out the GetCampaigns Java example and the other client library examples for more details.

Cheers,
Josh, AdWords API Team
Reply all
Reply to author
Forward
0 new messages