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/