Skip to main content

Get

Gets entities by the specified IDs. You can set an ID in string or integer or set a set of IDs in a list of strings or a list of integers as shown in the four types of request bodies below.


POST
https://{cluster-endpoint}/v1/vector/get

Example

Notes

You can use either of the following ways to authorize:

  • An API Key with appropriate permissions.
  • A colon-joined username and password of the target cluster. For example, username:p@ssw0rd.

Currently, data of the JSON and Array types are not supported in RESTful API requests..

  • Get a specified entity whose ID is an integer.
curl --request POST \
--url "${CLUSTER_ENDPOINT}/v1/vector/get" \
--header "Authorization: Bearer ${TOKEN}" \
--header "accept: application/json" \
--header "content-type: application/json" \
-d '{
"collectionName": "medium_articles",
"outputFields": ["id", "title", "link"],
"id": 1
}'
  • Get a specified entity whose ID is a string:
curl --request POST \
--url "${CLUSTER_ENDPOINT}/v1/vector/get" \
--header "Authorization: Bearer ${TOKEN}" \
--header "accept: application/json" \
--header "content-type: application/json" \
-d '{
"collectionName": "medium_articles",
"outputFields": ["id", "title", "link"],
"id": "id1"
}'
  • Get a list of entities whose IDs are integers:
curl --request POST \
--url "${CLUSTER_ENDPOINT}/v1/vector/get" \
--header "Authorization: Bearer ${TOKEN}" \
--header "accept: application/json" \
--header "content-type: application/json" \
-d '{
"collectionName": "medium_articles",
"outputFields": ["id", "title", "link"],
"id": [1, 2]
}'
  • Get a list of entities whose IDs are strings:
curl --request POST \
--url "${CLUSTER_ENDPOINT}/v1/vector/get" \
--header "Authorization: Bearer ${TOKEN}" \
--header "accept: application/json" \
--header "content-type: application/json" \
-d "{
"collectionName": "medium_articles",
"outputFields": ["id", "title", "link"],
"id": ["id1", "id2"]
}"

Request

Parameters

  • No query parameters required

  • No path parameters required

Request Body

{
"dbName": "string",
"collectionName": "string",
"partitionNames": [],
"outputFields": [],
"id": "string"
}
ParameterDescription
dbNamestring
The name of the database.
collectionNamestring
The name of the collection to which this operation applies.
partitionNamesarray
The name of the partitions to which this operation applies.
partitionNames[]string
partitionName
outputFieldsarray
An array of fields to return along with the search results.
outputFields[]string
idstring
The ID of the entity to be retrieved
{
"dbName": "string",
"collectionName": "string",
"outputFields": [],
"id": []
}
ParameterDescription
dbNamestring
The name of the database.
collectionNamestring
The name of the collection to which this operation applies.
outputFieldsarray
An array of fields to return along with the search results.
outputFields[]string
idarray
An array of IDs of the entities to be retrieved
id[]string
An ID represents an entity.
{
"dbName": "string",
"collectionName": "string",
"outputFields": [],
"id": "integer"
}
ParameterDescription
dbNamestring
The name of the database.
collectionNamestring
The name of the collection to which this operation applies.
outputFieldsarray
An array of fields to return along with the search results.
outputFields[]string
idinteger
The ID of entity to be retrieved
{
"dbName": "string",
"collectionName": "string",
"outputFields": [],
"id": []
}
ParameterDescription
dbNamestring
The name of the database.
collectionNamestring
The name of the collection to which this operation applies.
outputFieldsarray
An array of fields to return along with the search results.
outputFields[]string
idarray
An array of IDs of the entities to be retrieved
id[]integer

Response

Returns the search results.

Response Bodies

  • Response body if we process your request successfully
{
"code": "integer",
"data": [
{}
]
}
  • Response body if we failed to process your request
{
"code": integer,
"message": string
}

Properties

The properties in the returned response are listed in the following table.

PropertyDescription
codeinteger
dataarray
data[]object
messagestring
Indicates the possible reason for the reported error.

Possible Errors

CodeError Message
80000Incorrect parameter: xxx
80001The token is illegal
80002The token is invalid
80020Cluster not exist or you don't have permission.
90001The collection xxx does not exist. You can use ListCollections to view the list of existing collections.
90002The return value property xxx does not exist on collection xxx.
90011Invalid CollectionName. Reason: Name contains only alphanumeric letters and underscores
90102The cluster does not exist in current region.
90103The clusterId parameter is empty in the request path.
90110No filter key field.
90133No get content provided.
90139Type mismatch for field 'xxx'. expected type:xxx
90140The number of elements in parameter 'id' should not exceed 100.