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
Endpoint: googleads.googleapis.com:443
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?
On Monday, April 29, 2019 at 4:38:21 PM UTC+4:30, Mohammad Reza Kiani wrote:
>
> 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
> Endpoint: googleads.googleapis.com:443
> 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)
>
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 [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
---
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 [email protected].
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/faf501b3-1e2d-4945-af5f-fac3cbd702df%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.