Method: media.upload

This is an experimental feature. Please contact Google before using it. Uploads an image for the conversation to use as a source of information.

HTTP request

  • Upload URI, for media upload requests:
    POST https://retail.googleapis.com/upload/v2alpha/{catalog=projects/*/locations/*/catalogs/*}:uploadConversationImage
  • Metadata URI, for metadata-only requests:
    POST https://retail.googleapis.com/v2alpha/{catalog=projects/*/locations/*/catalogs/*}:uploadConversationImage

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
catalog

string

Required. Full resource name of the catalog, such as projects/*/locations/global/catalogs/default_catalog.

Request body

The request body contains data with the following structure:

JSON representation
{
  "conversationId": string,
  "visitorId": string,
  "mimeType": string,
  "sizeBytes": string,
  "imageBytes": string
}
Fields
conversationId

string

Optional. The conversation id of the conversation to upload the image for. If not provided, the image upload will start a new conversation and return the conversation id in the response.

visitorId

string

Required. A unique identifier for tracking visitors.

This should be the same identifier as UserEvent.visitor_id.

mimeType

string

Optional. The mime type of the image to be uploaded.

sizeBytes

string (int64 format)

Optional. The size of the image in bytes.

imageBytes

string (bytes format)

Optional. The image content provided inline.

Also supports passing base64 encoded image bytes. See an example here: (https://cloud.google.com/vertex-ai/docs/general/base64).

A base64-encoded string.

Response body

This is an experimental feature. Please contact Google before using it. Response message for ConversationalSearchService.UploadConversationImage method.

If successful, the response body contains data with the following structure:

JSON representation
{
  "conversationImageId": string,
  "conversationId": string
}
Fields
conversationImageId

string

The conversation image id of the uploaded image.

conversationId

string

The conversation id of the conversation to upload the image for.

Authorization scopes

Requires the following OAuth scope:

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

For more information, see the Authentication Overview.