google-ads-api icon indicating copy to clipboard operation
google-ads-api copied to clipboard

Mutate operations must have 'create', 'update', or 'remove' specified

Open hcyildirim opened this issue 2 years ago • 2 comments

Hi, I'm trying to delete a campaign and I'm getting an error:

 await customer.mutateResources([
      {
        entity: 'campaign',
        operation: 'remove',
        resource_name: resource_name,
      },
    ]);
 {
            "error_code": {
                "request_error": "OPERATION_REQUIRED"
            },
            "message": "Mutate operations must have 'create', 'update', or 'remove' specified.",
            "location": {
                "field_path_elements": [
                    {
                        "field_name": "mutate_operations",
                        "index": 0
                    },
                    {
                        "field_name": "campaign_operation"
                    }
                ]
            }
        }

hcyildirim avatar Oct 04 '21 11:10 hcyildirim

Hi, i have same problem, with CustomerUserAccess and CustomerUserAccessInvitation resources, when trying to make any mutation operation

@hcyildirim have you found a way how to solve it ?

receving same response

GoogleAdsFailure {
  errors: [
    GoogleAdsError {
    error_code: [ErrorCode],
      message: "Mutate operations must have 'create', 'update', or 'remove' specified.",
     location: [ErrorLocation]
    }
  ],
   request_id: 'llPd2Z1j81XqbgfwBw8BpQ'
 }

KirillPerepelitsa avatar Oct 20 '21 06:10 KirillPerepelitsa

Hello 👋 I have the same issue as well when trying to create a smart campaign setting

    const req = SmartCampaignSetting.create({
      campaign: campaignResourceName,
      phone_number: {
        country_code: request.campaign.prefix,
        phone_number: request.campaign.phone_number,
      },
      advertising_language_code: request.targeting.advertisement_language,
      final_url: 'https://www.example.com',
      business_name: 'Lorem ipsum',
    });

const response = await customer.mutateResources([
      {
        entity: 'smart_campaign_setting',
        operation: 'create',
        resource: req,
      },
    ]);

@hcyildirim @KirillPerepelitsa did you find the root cause for this type of error?

jRexhmati avatar Jan 11 '23 07:01 jRexhmati