Hi,
I'm following
https://developers.google.com/google-ads/api/docs/assets/location-assets#add-location-assets
and trying the use case:
1.
1.
- Set maps_location_set if you want to manually add locations
using Place IDs
<https://developers.google.com/maps/documentation/places/web-service/place-id>
.
here's my request:
mutate_operations {
asset_set_operation {
create {
name: "TestAsset"
type: LOCATION_SYNC
status: ENABLED
location_set {
location_ownership_type: AFFILIATE
maps_location_set {
maps_locations {
place_id: "ChIJQbpW9fV8lUcRGnDfEihRplI"
}
}
}
}
}
}
the response is:
errors {
error_code {
field_error: VALUE_MUST_BE_UNSET
}
message: "The field cannot be set."
location {
field_path_elements {
field_name: "mutate_operations"
index: 0
}
field_path_elements {
field_name: "asset_set_operation"
}
field_path_elements {
field_name: "create"
}
field_path_elements {
field_name: "location_set"
}
}
}
request_id: "FyBdmRVB1IzIrwoVDGOhOQ"
which doesn't make sense to me. if I leave location_set out I'm getting the
opposite error:
errors {
error_code {
field_error: REQUIRED
}
message: "The required field was not present."
location {
field_path_elements {
field_name: "mutate_operations"
index: 0
}
field_path_elements {
field_name: "asset_set_operation"
}
field_path_elements {
field_name: "create"
}
field_path_elements {
field_name: "location_set"
}
}
}
request_id: "laSfUZi1RSsH37RpOhOa0Q"
and if I set a ChainLocationSet instead of the MapsLocationSet it all works.
Here's my code in Java:
AssetSet.newBuilder() .setName("TestAsset")
.setType(AssetSetTypeEnum.AssetSetType.LOCATION_SYNC)
.setStatus(AssetSetStatusEnum.AssetSetStatus.ENABLED)
.setLocationSet(LocationSet.newBuilder()
.setLocationOwnershipType(LocationOwnershipTypeEnum.LocationOwnershipType.AFFILIATE)
// this doesn't work .setMapsLocationSet(MapsLocationSet.newBuilder()
.addMapsLocations(MapsLocationInfo.newBuilder()
.setPlaceId("ChIJQbpW9fV8lUcRGnDfEihRplI") ) ) // this works //
.setChainLocationSet(ChainSet.newBuilder() //
.setRelationshipType(ChainRelationshipTypeEnum.ChainRelationshipType.AUTO_DEALERS)
// .addAllChains( //
List.of(ChainFilter.newBuilder().setChainId(225757).build()) // ) // )
.build() );
I'm using "com.google.api-ads" % "google-ads" % "34.0.0"
Cheers
Andreas
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/adwords-api/ab4176c2-c0cb-4dc9-b444-3bdb32733f55n%40googlegroups.com.