'resourceName' works for me.

On Thursday, June 27, 2019 at 5:51:40 AM UTC-4 symb...@gmail.com wrote:

> We're always grateful for Google Ads API Team's help.
>
> Well, I'd like to create the Ad via curl, so I post the following JSON to: 
> https://googleads.googleapis.com/v1/customers/5838476xxx/adGroupAds:mutate
>
> {
>       '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'
>           }
>         }
>       }
>     }
>
> I receive the following response:
>
> {
>   "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"
>       }
>     ]
>   }
> }
>
> What does "RESOURCE_NOT_FOUND" mean? Does it mean to add 'resource_name' 
> above 'status'? But, I don't know how to write 'resource_name'.
> For example, 
>
> {
>       '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'
>           }
>         }
>       }
>     }
>
> But, response is
>
> {
>   "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"
>       }
>     ]
>   }
> }
>
> What's wrong? Could you give me correct JSON code or a clue? I need your 
> help.
>
> Thanks.
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
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 adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/58f95369-f331-4ea1-97ad-82b02fe3de3an%40googlegroups.com.

Reply via email to