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/entity/{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/entity/{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.

FieldDescription
idThe unique identifier of the custom entity. You can use the ID to get, update, and delete the custom entity.
typeThe type of the custom entity.
subTypeThe subtype of the custom entity.
categoryThe value is Custom.
valuesThe 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.

ParameterDescription
subTypeFilter 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.

FieldDescription
entitiesA 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"
      ]
    }
  ]
}

Did this page help you?