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), 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:
Any suggestions?