{
'operations': {
'create': {
'status': 'ENABLED',
'ad_group': 'customers/5838476xxx/adGroups/75043676xxx',
'ad': {
'final_urls': ['https://www.foo.com/'],
'type': 'RESPONSIVE_SEARCH_AD',
'added_by_google_ads': true,
'name': 'New Ad 1'
}
}
}
}{
"error": {
"status": "INVALID_ARGUMENT",
"message": "Request contains an invalid argument.",
"code": 400,
"details": [
{
"errors": [
{
"errorCode": {
"mutateError": "RESOURCE_NOT_FOUND"
},
"message": "Resource was not found.",
"trigger": {
"stringValue": "<null>"
},
"location": {
"fieldPathElements": [
{
"index": "0",
"fieldName": "operations"
},
{
"fieldName": "create"
},
{
"fieldName": "resource_name"
}
]
}
}
],
"@type": "type.googleapis.com/google.ads.googleads.v1.errors.GoogleAdsFailure"
}
]
}
}{
'operations': {
'create': {
'resource_name':'customers/5838476xxx/adGroupAds/75043676xxx~1',
'status': 'ENABLED',
'ad_group': 'customers/5838476xxx/adGroups/75043676xxx',
'ad': {
'final_urls': ['https://www.foo.com/'],
'type': 'RESPONSIVE_SEARCH_AD',
'added_by_google_ads': true,
'name': 'New Ad 1'
}
}
}
}{
"error": {
"status": "INVALID_ARGUMENT",
"message": "Request contains an invalid argument.",
"code": 400,
"details": [
{
"errors": [
{
"errorCode": {
"newResourceCreationError": "CANNOT_SET_ID_FOR_CREATE"
},
"message": "Do not set the id field while creating new resources.",
"trigger": {
"int64Value": "1"
},
"location": {
"fieldPathElements": [
{
"index": "0",
"fieldName": "operations"
},
{
"fieldName": "create"
},
{
"fieldName": "resource_name"
}
]
}
}
],
"@type": "type.googleapis.com/google.ads.googleads.v1.errors.GoogleAdsFailure"
}
]
}
}Hi,
Thank you for reaching out. The RESOURCE_NOT_FOUND is usually seen if the resource is not formed correctly or is not available. Can you also include the asset resource and retry the request?
For the second concern, CANNOT_SET_ID_FOR_CREATE it looks like you are adding the AdGroupAd resource on the ad creation. If you’re creating a new Ad, this is not required. If you are updating an existing ad, the update field mask should be specified. Could you please give this a try and let us know if you have any issues?
Regards,
Nikisha Patel, Google Ads API Team