Get entities
This page describes how to get custom entities that you created using the Management API.
For more information about the Entity Detection feature, see Entity Detection.
Entity Detection - Management API
This section provides basic examples of how to get one custom entity or multiple of the custom entities that you created using the Management API.
Authentication
These requests require an access token, as described in Authenticate.
Get an entity
To get a custom entity from the Management API, use the GET <https://api.symbl.ai/v1/manage/entities/{entityId}
> operation.
import fetch from 'node-fetch';
const accessToken = '<ACCESS_TOKEN>';
const entityId = '<ENTITY_ID>';
const fetchResponse = await fetch(`https://api.symbl.ai/v1/manage/entities/{entityId}`, {
method: get,
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json'
}
});
const responseBody = await fetchResponse.json();
console.log(responseBody);
Where:
<ACCESS_TOKEN>
is a valid API access token.<ENTITY_ID>
is the ID of a custom entity that you previously created.
Response
The following table describes the response body that is returned by this request.
Field | Description |
---|---|
id | The unique identifier of the custom entity. You can use the ID to get, update, and delete the custom entity. |
type | The type of the custom entity. |
subType | The subtype of the custom entity. |
category | The value is Custom . |
values | The list of vocabulary for the custom entity. |
Example response
{
"id": "4476908732794496",
"type": "Vehicle",
"subType": "TeslaModel",
"category": "Custom",
"values": [
"Model X",
"Model S",
"Model 3",
"Model Y"
]
}
Get multiple entities
To get multiple custom entities that you created using the Management API, use the GET <https://api.symbl.ai/v1/manage/entities
> operation.
import fetch from 'node-fetch';
const accessToken = '<ACCESS_TOKEN>';
const fetchResponse = await fetch('https://api.symbl.ai/v1/manage/entities', {
method: get,
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json'
}
});
const responseBody = await fetchResponse.json();
console.log(responseBody);
Where:
<ACCESS_TOKEN>
is a valid API access token.
Optional query parameters
The following table describes the optional query parameters that can be used with this request.
Parameter | Description |
---|---|
subType | Filter the response by the subtype of a custom entity. When you use this parameter, the request returns only the entity that matches the subtype. |
Example URL with query parameters
https://api.symbl.ai/v1/manage/entities?subType=TeslaModel
Response
The following table describes the response body that is returned by this request.
Field | Description |
---|---|
entities | A list of entities. For the response fields specific to an individual entity, see Get an Entity. |
Example response
{
"entities": [
{
"id": "4476908732794496",
"type": "Vehicle",
"subType": "TeslaModel",
"category": "Custom",
"values": [
"Model X",
"Model S",
"Model 3",
"Model Y"
]
},
{
"id": "3242908732344496",
"type": "Vehicle",
"subType": "TeslaTruck",
"category": "Custom",
"values": [
"Cyber truck",
"Semi truck"
]
}
]
}
Updated 4 months ago