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"
}
Parameter | Description |
---|---|
collectionName | string The name of the collection to which this operation applies. |
outputFields | array An array of fields to return along with the search results. |
outputFields[] | string |
id | string The ID of the entity to be retrieved |
Option 2:
{
"collectionName": "string",
"outputFields": [],
"id": []
}
Parameter | Description |
---|---|
collectionName | string The name of the collection to which this operation applies. |
outputFields | array An array of fields to return along with the search results. |
outputFields[] | string |
id | array An array of IDs of the entities to be retrieved |
id[] | string An ID represents an entity. |
Option 3:
{
"collectionName": "string",
"outputFields": [],
"id": "integer"
}
Parameter | Description |
---|---|
collectionName | string The name of the collection to which this operation applies. |
outputFields | array An array of fields to return along with the search results. |
outputFields[] | string |
id | integer The ID of entity to be retrieved |
Option 4:
{
"collectionName": "string",
"outputFields": [],
"id": []
}
Parameter | Description |
---|---|
collectionName | string The name of the collection to which this operation applies. |
outputFields | array An array of fields to return along with the search results. |
outputFields[] | string |
id | array An array of IDs of the entities to be retrieved |
id[] | integer |
Response
Returns the search results.
Response Body
{
"code": "integer",
"data": [
{}
]
}
Property | Description |
---|---|
code | integer Indicates whether the request succeeds.
|
data | array |
data[] | object |
Error Response
{
"code": integer,
"message": string
}
Property | Description |
---|---|
code | integer Indicates whether the request succeeds.
|
message | string Indicates the possible reason for the reported error. |