Is there a bug with labels and temporary IDs?

25 views
Skip to first unread message

Брат Серёга

unread,
Jun 25, 2019, 6:14:39 AM6/25/19
to AdWords API and Google Ads API Forum
I try to create campaign budget, campaign, label and campaign label with single call to GoogleAdsService.Mutate and gets error:

```
    {
      "error_code": {
        "ErrorCode": {
          "RequestError": 11
        }
      },
      "message": "Field 'resource_name' cannot be modified by 'CREATE' operation.",
      "location": {
        "field_path_elements": [
          {
            "field_name": "mutate_operations",
            "index": {
              "value": 1
            }
          },
          {
            "field_name": "label_operation"
          },
          {
            "field_name": "create"
          },
          {
            "field_name": "resource_name"
          }
        ]
      }
    }
```

list of mutations:
```
[
  {
    "Operation": {
      "CampaignBudgetOperation": {
        "Operation": {
          "Create": {
            "resource_name": "customers/809xxxx186/campaignBudgets/-1",
            "amount_micros": {
              "value": 100500000
            },
            "delivery_method": 2,
            "explicitly_shared": {},
            "period": 2,
            "type": 2
          }
        }
      }
    }
  },
  {
    "Operation": {
      "LabelOperation": {
        "Operation": {
          "Create": {
            "resource_name": "customers/809xxxx186/labels/-2",
            "name": {
              "value": "yyy:zzz:777"
            },
            "text_label": {
              "background_color": {
                "value": "#940CFE"
              },
              "description": {
                "value": "generated label"
              }
            }
          }
        }
      }
    }
  },
  {
    "Operation": {
      "CampaignOperation": {
        "Operation": {
          "Create": {
            "resource_name": "customers/809xxxx186/campaigns/-3",
            "name": {
              "value": "Test Campaign"
            },
            "status": 3,
            "advertising_channel_type": 4,
            "shopping_setting": {
              "merchant_id": {
                "value": 121868788
              },
              "sales_country": {
                "value": "RU"
              },
              "campaign_priority": {}
            },
            "campaign_budget": {
              "value": "customers/809xxxx186/campaignBudgets/-1"
            },
            "bidding_strategy_type": 9,
            "CampaignBiddingStrategy": {
              "TargetSpend": {
                "cpc_bid_ceiling_micros": {
                  "value": 10000000
                }
              }
            }
          }
        }
      }
    }
  },
  {
    "Operation": {
      "CampaignLabelOperation": {
        "Operation": {
          "Create": {
            "campaign": {
              "value": "customers/809xxxx186/campaigns/-3"
            },
            "label": {
              "value": "customers/809xxxx186/labels/-2"
            }
          }
        }
      }
    }
  }
]
```
Reply all
Reply to author
Forward
0 new messages