This is the unified documentation for Retail API. This includes Recommendations AI, Retail Search, and the unified Retail console (which is applicable to both Recommendations AI and Retail Search users). To use the new console or Retail Search while they are in the restricted GA phase, submit a form here to contact Cloud sales. If you are using the v1beta version of Recommendations AI, migrate to the GA version: Migrating to the Retail API from beta.

To see documentation for only Recommendations AI and the Recommendations AI-only console, go to the How-to guides for Recommendations AI and the API reference documentation for Recommendations AI.

Method: projects.locations.catalogs.userEvents.import

Bulk import of User events. Request processing might be synchronous. Events that already exist are skipped. Use this method for backfilling historical user events.

Operation.response is of type ImportResponse. Note that it is possible for a subset of the items to be successfully inserted. Operation.metadata is of type ImportMetadata.

HTTP request

POST https://retail.googleapis.com/v2beta/{parent=projects/*/locations/*/catalogs/*}/userEvents:import

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
parent

string

Required. projects/1234/locations/global/catalogs/default_catalog

Request body

The request body contains data with the following structure:

JSON representation
{
  "inputConfig": {
    object (UserEventInputConfig)
  },
  "errorsConfig": {
    object (ImportErrorsConfig)
  }
}
Fields
inputConfig

object (UserEventInputConfig)

Required. The desired input location of the data.

errorsConfig

object (ImportErrorsConfig)

The desired location of errors incurred during the Import. Cannot be set for inline user event imports.

Response body

If successful, the response body contains an instance of Operation.

Authorization Scopes

Requires the following OAuth scope:

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

For more information, see the Authentication Overview.

IAM Permissions

Requires the following IAM permission on the parent resource:

  • retail.userEvents.import

For more information, see the IAM documentation.

UserEventInputConfig

The input config source for user events.

JSON representation
{

  // Union field source can be only one of the following:
  "userEventInlineSource": {
    object (UserEventInlineSource)
  },
  "gcsSource": {
    object (GcsSource)
  },
  "bigQuerySource": {
    object (BigQuerySource)
  }
  // End of list of possible types for union field source.
}
Fields
Union field source. The source of the input. source can be only one of the following:
userEventInlineSource

object (UserEventInlineSource)

Required. The Inline source for the input content for UserEvents.

gcsSource

object (GcsSource)

Required. Google Cloud Storage location for the input content.

bigQuerySource

object (BigQuerySource)

Required. BigQuery input source.

UserEventInlineSource

The inline source for the input config for userEvents.import method.

JSON representation
{
  "userEvents": [
    {
      object (UserEvent)
    }
  ]
}
Fields
userEvents[]

object (UserEvent)

Required. A list of user events to import. Recommended max of 10k items.