Receive CREATE_OPERATION_NOT_PERMITTED error for campaign creation

768 views
Skip to first unread message

Mohammad Reza Kiani

unread,
Apr 29, 2019, 8:08:21 AM4/29/19
to AdWords API and Google Ads API Forum
Hi,
I'm using google ads new api to create campaign. After I'v created a budget & a bidding strategy successfully, I failed to create the app using following code:
Campaign.newBuilder()
       
.setName(StringValue.of(request.name))
       
.setAdvertisingChannelType(AdvertisingChannelTypeEnum.AdvertisingChannelType.MULTI_CHANNEL)
       
// Recommendation: Set the request to PAUSED when creating it to prevent the ads from immediately serving.
        //                 Set to ENABLED once you've added targeting and the ads are ready to serve
        .setStatus(CampaignStatusEnum.CampaignStatus.PAUSED)
       
.setBiddingStrategy(StringValue.of(biddingStrategyResourceName))
       
.setCampaignBudget(StringValue.of(budgetResourceName))
       
.setNetworkSettings(networkSettings)
       
.setStartDate(StringValue.of(request.startDate.createCampaignFormat()))
       
.setEndDate(StringValue.of(request.startDate.createCampaignFormat()))
       
.build()
I receive below error and can't understand why:

Request
-------
MethodName: google.ads.googleads.v1.services.CampaignService/MutateCampaigns
Headers: {developer-token=REDACTED, x-goog-api-client=gl-java/1.8.0_172 gapic/ gax/1.35.0 grpc/1.16.1}
Body: customer_id: "9981465***"
operations {
  create {
    name {
      value: "Campaign Mohammad Reza Kiani 1556538987995"
    }
    status: PAUSED
    campaign_budget {
      value: "customers/9981465***/campaignBudgets/1898509417"
    }
    advertising_channel_type: MULTI_CHANNEL
    network_settings {
      target_google_search {
        value: true
      }
      target_search_network {
        value: true
      }
      target_content_network {
      }
      target_partner_search_network {
      }
    }
    start_date {
      value: "20190430"
    }
    end_date {
      value: "20190430"
    }
    bidding_strategy {
      value: "customers/9981465***/biddingStrategies/1946898398"
    }
  }
}


Response
--------
Headers: Metadata(content-type=application/grpc,request-id=3fml6VHnqNvxnIwkv6RjuQ,date=Mon, 29 Apr 2019 11:56:39 GMT,alt-svc=quic=":443"; ma=2592000; v="46,44,43,39")
Body: null
Failure message: errors {
  error_code {
    operation_access_denied_error: CREATE_OPERATION_NOT_PERMITTED
  }
  message: "Unauthorized CREATE operation in invoking a service\'s mutate method."
  trigger {
    string_value: ""
  }
  location {
    field_path_elements {
      field_name: "operations"
      index {
      }
    }
  }
}

Can you help me? Thanks
(I've hidden my 3 last digits of customer id)

Mohammad Reza Kiani

unread,
Apr 29, 2019, 9:27:15 AM4/29/19
to AdWords API and Google Ads API Forum
I solved that problem by setting api.googleads.loginCustomerId in ads.properties file and using new customerId in the explicite code (however I didn't understand what was the problem) and adding channelSubType to request. But now I'm receiving this error:
Request
-------
MethodName: google.ads.googleads.v1.services.CampaignService/MutateCampaigns
Headers: {developer-token=REDACTED, login-customer-id=9981465586, x-goog-api-client=gl-java/1.8.0_172 gapic/ gax/1.35.0 grpc/1.16.1}
Body: customer_id: "3576925***"
operations {
  create {
    name {
      value: "Campaign Mohammad Reza Kiani 1556544089409"
    }
    status: PAUSED
    campaign_budget {
      value: "customers/3576925***/campaignBudgets/1899034221"
    }
    advertising_channel_type: MULTI_CHANNEL
    advertising_channel_sub_type: APP_CAMPAIGN
    network_settings {
      target_google_search {
        value: true
      }
      target_search_network {
        value: true
      }
      target_content_network {
      }
      target_partner_search_network {
      }
    }
    start_date {
      value: "20190430"
    }
    end_date {
      value: "20190529"
    }
    bidding_strategy {
      value: "customers/3576925***/biddingStrategies/1947718545"
    }
  }
}


Response
--------
Headers: Metadata(content-type=application/grpc,request-id=w4BlqJAnULQmEYlS_Jx0Uw,date=Mon, 29 Apr 2019 13:21:40 GMT,alt-svc=quic=":443"; ma=2592000; v="46,44,43,39")
Body: null
Failure message: errors {
  error_code {
    operation_access_denied_error: MUTATE_ACTION_NOT_PERMITTED_FOR_CLIENT
  }
  message: "A mutate action is not allowed on this campaign, from this client."
  trigger {
    string_value: ""
  }
  location {
    field_path_elements {
      field_name: "operations"
      index {
      }
    }
  }
}

Can you help me again :D?

googleadsapi...@google.com

unread,
Apr 29, 2019, 1:48:33 PM4/29/19
to mohammad...@gmail.com, AdWords API and Google Ads API Forum
Hello Mohammad, 

I'm glad that the first issue has been resolved. If you are making API calls using OAuth credentials from a manager account and are accessing a related customer account, then you will need to specify the login-customer-Id in the request header. Please check this related blog post as a reference. 

The MUTATE_ACTION_NOT_PERMITTED_FOR_CLIENT is seen if the user is not allowed to perform the mutate action. Could you please check the access level for the email address used for generating the OAuth credentials? If you're still having an issue, could you please share the request and response logs without redacting along with the email address used for authentication, to check this further? You can reply back via Reply privately to author option.

Regards,
Bharani, Google Ads API Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Mohammad Reza Kiani

unread,
May 1, 2019, 2:25:57 AM5/1/19
to AdWords API and Google Ads API Forum
Thank you for attention.
I can't understand something from your documentation as much as I tried.
What is the different between the loginCustomerId which is set in ads.properties file with the customer id I should use for mutation operations? (for example in campaignServiceClient.mutateCampaigns
I use a google ads account id for loginCustomerId which is visible near name box in googleads panel but I can't understand what should I use for calling mutate operations?

googleadsapi...@google.com

unread,
May 2, 2019, 11:38:20 AM5/2/19
to mohammad...@gmail.com, AdWords API and Google Ads API Forum
Hello Mohammad, 

Regret the delay as I was checking this internally with the team. The App Campaigns creation and management functionality is currently available on whitelisted accounts. You will need to contact your Google representative if you are interested in having your account whitelisted. 

We will be updating our guide shortly so that it is more clear. Let me know if you have any questions.

Thanks,
Bharani, Google Ads API Team

Mohammad Reza Kiani

unread,
May 4, 2019, 5:01:04 AM5/4/19
to AdWords API and Google Ads API Forum
My question is why this is happening for App Campaign in google-ads api. Because I could create and manage Universal App Campaign in adwords-api but here we have this rule which is against your motto that you can access all functionality using adwords in google-ads-api.
And I have another question that how can I access an App Campaign assets in google-ads-api?

googleadsapi...@google.com

unread,
May 7, 2019, 3:44:49 PM5/7/19
to mohammad...@gmail.com, AdWords API and Google Ads API Forum
Hi Mohammed,

Thank you for reaching out, and apologies that you've run into this issue.

There is actually a separate whitelist for UAC in the Google Ads API, which is why you're unable to access those assets in the Google Ads API. The problem is temporary and will be resolved so that you can access App Campaign assets in the Google Ads API in the same way you were able to in the AdWords API. I spoke with the person who is managing this project and they expect to post more information about this on the developer blog very soon, so please monitor the blog for more information.

Hope that helps, let me know if you have any further questions.

Best,
Ben Karl, Google Ads API Team 


=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups "AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/3b83a809-48c5-4cdb-9367-7fe758a2de5b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages