OperationAccessDenied.ADD_OPERATION_NOT_PERMITTED @ class campaignmgmt.campaign.MutateAction (ADD) requires CREATE_CAMPAIGN

480 views
Skip to first unread message

dev...@hagglehq.com.au

unread,
Dec 19, 2014, 7:36:00 AM12/19/14
to adwor...@googlegroups.com
I have searched for the error but didn't find any solution.

CampaignOperation operation = new CampaignOperation();
            operation.OperationType = "CREATE_CAMPAIGN";
            operation.@operator = Operator.ADD;
            operation.operand = campaign;
            
            CampaignOperation[] operations = new CampaignOperation[] { operation };


           
            CampaignService campaignService = (CampaignService)user.GetService(AdWordsService.v201409.CampaignService);

            campaignService.RequestHeader.clientCustomerId = ConfigurationManager.AppSettings["ClientCustomerId"];
            
            CampaignReturnValue retVal = campaignService.mutate(operations);

When I tried to execute the last line "CampaignReturnValue retVal = campaignService.mutate(operations);", It gives error "OperationAccessDenied.ADD_OPERATION_NOT_PERMITTED @ class campaignmgmt.campaign.MutateAction (ADD) requires CREATE_CAMPAIGN" .

Please help me to resolve me this issue.

Josh Radcliff (AdWords API Team)

unread,
Dec 19, 2014, 10:17:46 AM12/19/14
to adwor...@googlegroups.com
Hi,

Have you tried not setting operation.OperationType? That value isn't required, and by setting it to a value that the API doesn't recognize you may be triggering that error.

You may want to check out the AddCampaigns.cs example and compare it to how you are setting up your operations.

Thanks,
Josh, AdWords API Team

Abhinash Dora

unread,
Dec 22, 2014, 4:52:39 AM12/22/14
to adwor...@googlegroups.com

Hi Josh,

I have tried without setting operation.OperationType, but still getting the same error.
My Code is: 
CampaignService campaignService = (CampaignService)user.GetService(AdWordsService.v201409.CampaignService);

campaignService.RequestHeader.clientCustomerId = ConfigurationManager.AppSettings["ClientCustomerId"];

CampaignOperation operation = new CampaignOperation();
operation.@operator = Operator.ADD;
operation.operand = campaign;

List<CampaignOperation> operations = new List<CampaignOperation>();
operations.Add(operation);

CampaignReturnValue retVal = campaignService.mutate(operations.ToArray());

Last line gives error.
Can you have any other solution.

Danial Klimkin

unread,
Dec 22, 2014, 8:23:48 AM12/22/14
to adwor...@googlegroups.com
Hello Abhinash,


Please make sure the clientCustomerId you are setting is not for an MCC account. You can't create campaigns on the MCC level.


-Danial, AdWords API Team.

Abhinash Dora

unread,
Dec 24, 2014, 1:00:46 AM12/24/14
to adwor...@googlegroups.com
Hello, 
Can you suggest me which clientCustomerId I should use to create campaigns in the test account.

Regards,
Abhinash

Danial Klimkin

unread,
Dec 24, 2014, 5:25:47 AM12/24/14
to adwor...@googlegroups.com
Hello Abhinash,


You need to create a non-MCC account under the test MCC. You can use the ManagedCustomerService or do this via the user interface.


-Danial, AdWords API Team.

Abhinash Dora

unread,
Dec 26, 2014, 2:26:11 AM12/26/14
to adwor...@googlegroups.com
Thanks Josh and Danial, finally able to create campaign succesfully.

Cheers,
Abhinash
Reply all
Reply to author
Forward
0 new messages