Method: projects.locations.corpora.collections.addCollectionItem

Adds an item into a Collection.

HTTP request

POST https://visionai.googleapis.com/v1alpha1/{item.collection=projects/*/locations/*/corpora/*/collections/*}:addCollectionItem

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
item.collection

string

Required. The collection name that this item belongs to. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}

Request body

The request body contains data with the following structure:

JSON representation
{
  "item": {
    "collection": string,
    "type": enum (Type),
    "itemResource": string
  }
}
Fields
item.type

enum (Type)

Required. The type of item.

item.itemResource

string

Required. The name of the CollectionItem. Its format depends on the type above. For ASSET: projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}

Response body

Response message for collections.addCollectionItem.

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

JSON representation
{
  "item": {
    object (CollectionItem)
  }
}
Fields
item

object (CollectionItem)

The item that has already been added.

Authorization scopes

Requires the following OAuth scope:

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

For more information, see the Authentication Overview.