Hi
My client is trying to update assets of an ads in an app campaign:
async function addAdGroupAds (service, a) {
const adSetvice = service.getAdService();
const operations = [{
operator: 'SET',
operand:
{
'xsi:type': 'UniversalAppAd',
id: 'xxxxxxxx',
images: [
{
asset: {
"attributes": {
'xsi:type': 'ImageAsset',
},
assetId: 'xxxx'
}
}
]
}
}];
await adSetvice.mutate({operations: operations});
}
Got following error:
{"Fault":{"faultcode":"soap:Client","faultstring":"[CollectionSizeError.TOO_FEW
@ operations[0].operand.headlines, CollectionSizeError.TOO_FEW @
operations[0].operand.descriptions]","detail":{"ApiExceptionFault":{"message":"[CollectionSizeError.TOO_FEW
@ operations[0].operand.headlines, CollectionSizeError.TOO_FEW @
operations[0].operand.descriptions]","ApplicationException.Type":"ApiException","errors":[{"attributes":{"xsi:type":"CollectionSizeError"},"fieldPath":"operations[0].operand.headlines","fieldPathElements":[{"field":"operations","index":0},{"field":"operand"},{"field":"headlines"}],"trigger":"","errorString":"CollectionSizeError.TOO_FEW","ApiError.Type":"CollectionSizeError","reason":"TOO_FEW"},{"attributes":{"xsi:type":"CollectionSizeError"},"fieldPath":"operations[0].operand.descriptions","fieldPathElements":[{"field":"operations","index":0},{"field":"operand"},{"field":"descriptions"}],"trigger":"","errorString":"CollectionSizeError.TOO_FEW","ApiError.Type":"CollectionSizeError","reason":"TOO_FEW"}]}}}}}},"response":{"statusCode":500,"body":"<soap:Envelope
xmlns:
Based on this error and the doc(ss
<https://screenshot.googleplex.com/fvvYMexg43x>), I suggested them to add
headlines and descriptions in the request.
They re-tried with the following code:
async function addAdGroupAds (service, a) {
const adSetvice = service.getAdService();
const operations = [{
operator: 'SET',
operand:
{
'xsi:type': 'UniversalAppAd',
id: 'xxxxxxxx',
images: [
{
asset: {
"attributes": {
'xsi:type': 'ImageAsset',
},
assetId: 'xxxx'
}
}
],
headlines: [
{
"asset": {
"attributes": {
"xsi:type": "TextAsset"
},
"assetId": "xxxx",
"assetSubtype": "TEXT",
"Asset.Type": "TextAsset",
"assetText": "xxxx"
}
},
{
"asset": {
"attributes": {
"xsi:type": "TextAsset"
},
"assetId": "xxxxx",
"assetSubtype": "TEXT",
"Asset.Type": "TextAsset",
"assetText": "xxxx"
},
},
{
"asset": {
"attributes": {
"xsi:type": "TextAsset"
},
"assetId": "xxxx",
"assetSubtype": "TEXT",
"Asset.Type": "TextAsset",
"assetText": "xxx"
},
},
{
"asset": {
"attributes": {
"xsi:type": "TextAsset"
},
"assetId": "xxx",
"assetSubtype": "TEXT",
"Asset.Type": "TextAsset",
"assetText": "xxxxx"
},
}
],
descriptions: [
{
"asset": {
"attributes": {
"xsi:type": "TextAsset"
},
"assetId": "xxxx",
"assetSubtype": "TEXT",
"Asset.Type": "TextAsset",
"assetText": "xxxx"
},
}
]
},
}];
await adSetvice.mutate({operations: operations});
}
The returned error is:
Invalid content was found starting with element '{\"
https://adwords.google.com/api/adwords/cm/v201809\":headlines}'. One of '{\"
https://adwords.google.com/api/adwords/cm/v201809\":images, \"
https://adwords.google.com/api/adwords/cm/v201809\":videos, \"
https://adwords.google.com/api/adwords/cm/v201809\":html5MediaBundles}' is
expected."}}}},"response":{"statusCode":500,....
Any suggestions?
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/87e6d9f6-79e9-4f4f-a7ce-ec9b734f1b0c%40googlegroups.com.