Re: App Campaign Create Asset API questions

2019-11-19 Thread 'Naomi Shao' via AdWords API and Google Ads API Forum
Hi Bharani,

Thanks for the reply. However it is still not working properly on my end. 
Below is the error. 
And could you pls help me understand the resource name in 
setAsset(StringValue.of(ResourceNames.asset(customerId, 6544940770L))), 
where exactly can I find the string '6544940770L'? Let's say I want to 
create asset with a youtube video.

Thank you,
Naomi

*Response*
**
*Headers: 
Metadata(content-type=application/grpc,request-id=JNDapajHOqzoe95NLssjHQ,x-google-esf-cloud-client-params=client_project_number:
 
38977083346 backend_service_name: "googleads.googleapis.com" 
backend_fully_qualified_method: 
"google.ads.googleads.v2.services.AdGroupAdService.MutateAdGroupAds" 
,x-google-session-info=CNXvz9aUBxoEGBAoCzpqEhhnb29nbGVhZHMuZ29vZ2xlYXBpcy5jb20Y0q_cmZEBIkczODk3NzA4MzM0Ni1tNG1lN28yODVoNXVvNjVqYWZrampsNXJhOHNvbHY4NS5hcHBzLmdvb2dsZXVzZXJjb250ZW50LmNvbUoPOg0xLy8wZVZodTRuQW1-,date=Wed,
 
20 Nov 2019 02:42:21 
GMT,x-google-gfe-request-trace=tlei5:443,tlac73:9832,/bns/im/borg/im/bns/adwords-simply/aw-webapi-esfproxy-prod.server/29,tlac73:9832,tlei5:443,x-google-gslb-service=adwords-frontend-webapi-esfproxy,x-google-backends=[2002:a05:681c:84::]:4232,/bns/im/borg/im/bns/adwords-simply/aw-webapi-esfproxy-prod.server/29,tlac73:9832,/bns/tl/borg/tl/bns/traffic-prod/shared-layer2-gfe/58,tlei5:443,x-google-dos-service-trace=main:adwords-frontend-webapi-esfproxy,main:shared-layer2-gfe,x-google-service=adwords-frontend-webapi-esfproxy,shared-layer2-grpc-aggregate,x-google-gfe-response-code-details-trace=response_code_set_by_backend,response_code_set_by_backend,x-google-gfe-response-body-transformations=chunked,chunked,x-google-shellfish-status=CA0gBEBG,alt-svc=quic=":443";
 
ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; 
ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; 
ma=2592000,h3-Q043=":443"; 
ma=2592000,x-google-gfe-service-trace=adwords-frontend-webapi-esfproxy,shared-layer2-grpc-aggregate)*
*Body: null*
*Failure message: errors {*
*  error_code {*
*collection_size_error: TOO_FEW*
*  }*
*  message: "Too few."*
*  trigger {*
*string_value: ""*
*  }*
*  location {*
*field_path_elements {*
*  field_name: "operations"*
*  index {*
*  }*
*}*
*field_path_elements {*
*  field_name: "create"*
*}*
*field_path_elements {*
*  field_name: "ad"*
*}*
*field_path_elements {*
*  field_name: "app_ad"*
*}*
*field_path_elements {*
*  field_name: "headlines"*
*}*
*field_path_elements {*
*  field_name: "pinned_field"*
*}*
*  }*
*}*
*errors {*
*  error_code {*
*mutate_error: RESOURCE_NOT_FOUND*
*  }*
*  message: "Resource was not found."*
*  trigger {*
*string_value: ""*
*  }*
*  location {*
*field_path_elements {*
*  field_name: "operations"*
*  index {*
*  }*
*}*
*field_path_elements {*
*  field_name: "create"*
*}*
*field_path_elements {*
*  field_name: "ad"*
*}*
*field_path_elements {*
*  field_name: "app_ad"*
*}*
*field_path_elements {*
*  field_name: "images"*
*  index {*
*  }*
*}*
*field_path_elements {*
*  field_name: "asset"*
*}*
*  }*
*}*
*errors {*
*  error_code {*
*mutate_error: RESOURCE_NOT_FOUND*
*  }*
*  message: "Resource was not found."*
*  trigger {*
*string_value: ""*
*  }*
*  location {*
*field_path_elements {*
*  field_name: "operations"*
*  index {*
*  }*
*}*
*field_path_elements {*
*  field_name: "create"*
*}*
*field_path_elements {*
*  field_name: "ad"*
*}*
*field_path_elements {*
*  field_name: "app_ad"*
*}*
*field_path_elements {*
*  field_name: "youtube_videos"*
*  index {*
*  }*
*}*
*field_path_elements {*
*  field_name: "asset"*
*}*
*  }*
*}*


On Wednesday, November 20, 2019 at 12:31:45 AM UTC+8, adsapiforumadvisor 
wrote:
>
> Hi Naomi, 
>
> The error indicates that the image asset and video asset resource names 
> are not formed correctly. You will need to use the Asset resource as part 
> of the resource name. Please find the code snippet below:
>
> AdVideoAsset video = AdVideoAsset.newBuilder()
> .setAsset(StringValue.of(ResourceNames.asset(customerId, 6544940770L)))
> .build();
>
> AdImageAsset image = AdImageAsset.newBuilder()
> .setAsset(StringValue.of(ResourceNames.asset(customerId, 27398859L)))
> .build();
>
> AppAdInfo appadinfo = AppAdInfo.newBuilder()
> .addDescriptions(text)
> .addAllHeadlines(ImmutableList.of(text, text1))
> .addAllDescriptions(ImmutableList.of(description))
> .addAllImages(ImmutableList.of(image))
> .addAllYoutubeVideos(ImmutableList.of(video))
> .build();
>
> Please give this a try and let me know if you have any questions.
>
> Thanks,
> Bharani, Google Ads API Team
>  
>
> ref:_00D1U1174p._5001UOCaSg:ref
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/

App Campaign Create Asset API questions

2019-11-19 Thread 'Naomi Shao' via AdWords API and Google Ads API Forum
Hi there,

I was trying to create ad group ad by referring to these docs - guide1 

 & guide2 
.
 
I don't quite understand how to add Image and Video assets - for 
AdImageAsset what should i put for resource name, is it the url? And for 
AdVideoAsset, i tried with the youtube_video_id (11 char id), getting 
"RESOURCE_NAME_MALFORMED is malformed: expected 
\'customers/{customer_id}/assets/{part_1}\'." error. Could you please 
help?  Below is my code snippet and my confused part is highlighted in red. 
Would be great if you could provide working example.

Thanks, Naomi


AdTextAsset headline =
AdTextAsset.newBuilder()
.setText(StringValue.of(String.format("This is a headline.")))
.build();

AdTextAsset description =
AdTextAsset.newBuilder()
.setText(StringValue.of(String.format("This is a 
description.")))
.build();

AdVideoAsset video =
AdVideoAsset.newBuilder()
.setAsset(StringValue.of(String.format("Eq8pzzqq7xE")))
.build();


AppAdInfo appAdInfo = AppAdInfo.newBuilder()
.addHeadlines(headline)
.addDescriptions(description)
.addYoutubeVideos(video)
.build();



// Wraps the info in an Ad object.
Ad ad =
Ad.newBuilder()
.setAppAd(appAdInfo)
.build();

// Builds the final ad group ad representation.
AdGroupAd adGroupAd =
AdGroupAd.newBuilder()
.setAdGroup(StringValue.of(adGroupResourceName))
.setStatus(AdGroupAdStatusEnum.AdGroupAdStatus.ENABLED)
.setAd(ad)
.build();

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/c4282181-d71d-4099-8ecf-478ca1780069%40googlegroups.com.


Re: Cannot ceate uac campiang with api, get OPERATION_NOT_PERMITTED_FOR_CAMPAIGN_TYPE error

2019-09-26 Thread 'Naomi Shao' via AdWords API and Google Ads API Forum
I am getting same error - weirdly I could create app campaign with Java but 
not Python...

On Tuesday, September 24, 2019 at 8:46:52 PM UTC+8, Viktor wrote:
>
>
> Hello, 
>
> I'm seeing the exact same error on my test account, and it was working a 
> few days ago so it's something that changed recently.
>
> Is there anywhere documentation on how to use UniversalAppCampaignInfo and 
> how to add the add assets (to an ad group i guess?) with the Java library?
>
> All the documentation you linked still uses UniversalAppCampaignSetting 
> and the examples fail with the error above...
>
>
> On Tuesday, September 24, 2019 at 10:41:02 AM UTC+3, adsapiforumadvisor 
> wrote:
>>
>> Hi,
>>
>> To better assist you, could you confirm if you are using the AdWords API 
>> ? If you 
>> are using the AdWords API, could you provide the complete SOAP request and 
>> response logs so I can further investigate? You may send your reply using 
>> the *Reply privately to author* option.
>>
>> Additionally, the documentation for creating UACs using the AdWords API 
>> can be found here 
>> .
>>  
>> You would also need to update your code based on the changes mentioned in 
>> this blog post 
>> 
>> . 
>>
>> Thanks and regards,
>> Peter
>> Google Ads API Team
>>
>> ref:_00D1U1174p._5001UHHk4V:ref
>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/20b249c3-a178-4d3b-8a82-ca017d375e4a%40googlegroups.com.


create app campaign using API beta has error MUTATE_ACTION_NOT_PERMITTED_FOR_CLIENT

2019-09-16 Thread 'Naomi Shao' via AdWords API and Google Ads API Forum
Hi,

I am trying to create an app campaign with the new API. I tried with both 
Java and Python, getting the same error message as below. The error message 
in Java is MUTATE_ACTION_NOT_PERMITTED_FOR_CLIENT, I don't understand what 
exactly I am trying to "mutate"? Basically I think the mutation is creating 
campaign and budget. I used the sample code of add_campaigns.py which came 
with the client lib as reference.

Attached is the python script, pls take a look and help! Thx!!

Request made: ClientCustomerId: 9189232388, Host: 
googleads.googleapis.com:443, Method: 
/google.ads.googleads.v2.services.CampaignService/MutateCampaigns, 
RequestId: mGoLwJYa1kppmiEsJYGjPg, IsFault: True, FaultMessage: A mutate 
action is not allowed on this campaign, from this client.

Request with ID "mGoLwJYa1kppmiEsJYGjPg" failed with status 
"INVALID_ARGUMENT" and includes the following errors:

Error with message "A mutate action is not allowed on this campaign, from 
this client.".

On field: operations

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/bd5f304d-a96d-41ad-8f68-a629e5dd43f0%40googlegroups.com.
#!/usr/bin/env python
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""This example illustrates how to add a campaign.

To get campaigns, run get_campaigns.py.
"""

from __future__ import absolute_import

import argparse
import datetime
import six
import sys
import uuid

import google.ads.google_ads.client


_DATE_FORMAT = '%Y%m%d'


def main(client, customer_id):
campaign_budget_service = client.get_service('CampaignBudgetService',
 version='v2')
campaign_service = client.get_service('CampaignService', version='v2')

# Create a budget, which can be shared by multiple campaigns.
campaign_budget_operation = client.get_type('CampaignBudgetOperation',
version='v2')
campaign_budget = campaign_budget_operation.create
campaign_budget.name.value = 'Interplanetary Budget 1 %s' % uuid.uuid4()
campaign_budget.delivery_method = client.get_type(
'BudgetDeliveryMethodEnum').STANDARD
campaign_budget.amount_micros.value = 50
#campaign_budget.explicitly_shared = False

# Add budget.
try:
campaign_budget_response = (
campaign_budget_service.mutate_campaign_budgets(
customer_id, [campaign_budget_operation]))
except google.ads.google_ads.errors.GoogleAdsException as ex:
print('Request with ID "%s" failed with status "%s" and includes the '
  'following errors:' % (ex.request_id, ex.error.code().name))
for error in ex.failure.errors:
print('\tError with message "%s".' % error.message)
if error.location:
for field_path_element in error.location.field_path_elements:
print('\t\tOn field: %s' % field_path_element.field_name)
sys.exit(1)

# Create campaign.
campaign_operation = client.get_type('CampaignOperation', version='v2')
campaign = campaign_operation.create
campaign.name.value = 'Python test campaign %s' % uuid.uuid4()
campaign.advertising_channel_type = client.get_type(
'AdvertisingChannelTypeEnum').MULTI_CHANNEL

# Set campaign sub type.
campaign.advertising_channel_sub_type = client.get_type(
'AdvertisingChannelSubTypeEnum').APP_CAMPAIGN


# Recommendation: Set the campaign 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.
campaign.status = 

Re: Create Video Campaign via google Ads API

2019-09-12 Thread 'Naomi Shao' via AdWords API and Google Ads API Forum
Hi Andrea

Did you resolve this issue? I am having the exact same error when creating 
App Campaign. Thanks!


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 {
  }
}
  }
}

Status: Status{code=INVALID_ARGUMENT, description=Request contains an 
invalid argument., cause=null}.
Request ID GAF3zpbJaI8GUYDwFN0tFA failed due to GoogleAdsException. 
Underlying errors:
  Error 0: 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 {
}
  }
}


On Wednesday, May 29, 2019 at 3:19:13 AM UTC+8, Andrea Primaverili wrote:
>
> Hi, Is possible to create Video campaigns via API? i tried to do so but it 
> returns me this error:
>
> Status: Status{code=INVALID_ARGUMENT, description=Request contains an 
> invalid argument., cause=null}.
> Exception in thread "main" 
> shaded.com.google.ads.googleads.v1.errors.GoogleAdsException: 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: "VIDEO"
>   }
>   location {
> field_path_elements {
>   field_name: "operations"
>   index {
>   }
> }
>   }
>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/bcba954a-720f-4a3b-85e8-fa439af2c894%40googlegroups.com.