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

  • No header parameters required

Request Body

Option 1:

{
"collectionName": "string",
"outputFields": [],
"id": "string"
}
ParameterDescription
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
idstring
The ID of the entity to be retrieved

Option 2:

{
"collectionName": "string",
"outputFields": [],
"id": []
}
ParameterDescription
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.

Option 3:

{
"collectionName": "string",
"outputFields": [],
"id": "integer"
}
ParameterDescription
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

Option 4:

{
"collectionName": "string",
"outputFields": [],
"id": []
}
ParameterDescription
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 Body

{
"code": "integer",
"data": [
{}
]
}
PropertyDescription
codeinteger
Indicates whether the request succeeds.
  • 0: The request succeeds.
  • Others: Some error occurs.
dataarray
data[]object

Error Response

{
"code": integer,
"message": string
}
PropertyDescription
codeinteger
Indicates whether the request succeeds.
  • 0: The request succeeds.
  • Others: Some error occurs.
messagestring
Indicates the possible reason for the reported error.