Method: customers.customAudiences.mutate

创建或更新自定义受众群体。返回操作状态。

抛出的错误列表:AuthenticationError AuthorizationError CustomAudienceError CustomInterestError FieldError FieldMaskError HeaderError InternalError MutateError OperationAccessDeniedErrorPolicyViolationErrorQuotaErrorRequestError

HTTP 请求

POST https://googleads.googleapis.com/v17/customers/{customerId}/customAudiences:mutate

网址采用 gRPC 转码语法。

路径参数

参数
customerId

string

必需。要修改其自定义受众群体的客户的 ID。

请求正文

请求正文中包含结构如下的数据:

JSON 表示法
{
  "operations": [
    {
      object (CustomAudienceOperation)
    }
  ],
  "validateOnly": boolean
}
字段
operations[]

object (CustomAudienceOperation)

必需。要对各个自定义受众群体执行的操作的列表。

validateOnly

boolean

如果为 true,则系统会验证该请求,但不会执行该请求。仅返回错误,不返回结果。

响应正文

自定义受众群体转变的响应消息。

如果成功,响应正文将包含结构如下的数据:

JSON 表示法
{
  "results": [
    {
      object (MutateCustomAudienceResult)
    }
  ]
}
字段
results[]

object (MutateCustomAudienceResult)

该转变的所有结果。

授权范围

需要以下 OAuth 范围:

  • https://www.googleapis.com/auth/adwords

如需了解详情,请参阅 OAuth 2.0 概览

CustomAudienceOperation

对自定义受众群体执行的单个操作(创建、更新)。

JSON 表示法
{
  "updateMask": string,

  // Union field operation can be only one of the following:
  "create": {
    object (CustomAudience)
  },
  "update": {
    object (CustomAudience)
  },
  "remove": string
  // End of list of possible types for union field operation.
}
字段
updateMask

string (FieldMask format)

用于确定在更新中修改哪些资源字段的 FieldMask。

这是完全限定字段名称的逗号分隔列表。示例:"user.displayName,photo"

联合字段 operation。Mutate 操作。operation 只能是下列其中一项:
create

object (CustomAudience)

创建操作:新的自定义受众群体不需要资源名称。

update

object (CustomAudience)

更新操作:自定义受众群体应具有有效的资源名称。

remove

string

移除操作:已移除的自定义受众群体的资源名称应如下所示:

customers/{customerId}/customAudiences/{custom_audience_id}

MutateCustomAudienceResult

自定义受众群体的结果转变。

JSON 表示法
{
  "resourceName": string
}
字段
resourceName

string

操作成功时返回。