Method: projects.locations.userEvents.import

批量导入用户事件。请求处理可能是同步的。系统会跳过已存在的活动。使用此方法可回填历史用户事件。

Operation.response 的类型为 ImportResponse。请注意,可能只有部分商品成功插入。Operation.metadata 的类型为 ImportMetadata。

HTTP 请求

POST https://discoveryengine.googleapis.com/v1beta/{parent=projects/*/locations/*}/userEvents:import

网址采用 gRPC 转码语法。

路径参数

参数
parent

string

必需。父级 DataStore 资源名称,格式为 projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}

请求正文

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

JSON 表示法
{
  "errorConfig": {
    object (ImportErrorConfig)
  },

  // Union field source can be only one of the following:
  "inlineSource": {
    object (InlineSource)
  },
  "gcsSource": {
    object (GcsSource)
  },
  "bigquerySource": {
    object (BigQuerySource)
  }
  // End of list of possible types for union field source.
}
字段
errorConfig

object (ImportErrorConfig)

导入期间发生错误的所需位置。无法针对内嵌用户事件导入进行设置。

联合字段 source。必需 - 用户事件数据的所需输入源。source 只能是下列其中一项:
inlineSource

object (InlineSource)

UserEvents 的输入内容的内嵌来源。

gcsSource

object (GcsSource)

输入内容所在的 Cloud Storage 位置。

bigquerySource

object (BigQuerySource)

BigQuery 输入源。

响应正文

如果成功,则响应正文包含一个 Operation 实例。

授权范围

需要以下 OAuth 范围之一:

  • https://www.googleapis.com/auth/cloud-platform
  • https://www.googleapis.com/auth/discoveryengine.readwrite
  • https://www.googleapis.com/auth/discoveryengine.assist.readwrite

如需了解详情,请参阅 Authentication Overview

IAM 权限

需要拥有 parent 资源的以下 IAM 权限:

  • discoveryengine.userEvents.import

如需了解详情,请参阅 IAM 文档