An Entity is a single person, place, or thing. You can extract Entities from a conversation using the Entities request in the Conversations API. Each distinct Entity can be extracted from a conversation. Examples include: location, person, date, number, organization, datetime, daterange, custom entity, and so on.

To support retrieving Entities from a conversation, we added a new detectEntities parameter to the Async API. It is set to false by default.

For the Async API Process Audio and Process Video endpoints, use detectEntities as a query parameter, such as https://api.symbl.ai/v1/process/audio?detectEntities=true. For the other APIs such as Process Text, pass detectEntities=true in the JSON Request Body.

Authentication

Before using this API, you must generate your authentication token (AUTH_TOKEN) as described in Authenticate.


Get entities

Note that before you extract Entities, you must process a conversation with 'detectEntities=true' and use the resulting Conversation ID here.

Pass the new Conversation ID in the Conversations API Retrieve Entities by conversation ID.

For example, use the following GET Entities request to extract Entities from a conversation.

Retrieve Entities

Remember to replace CONVERSATION_ID in the Entities request with the Conversation ID from the previous API response.

Extract Entities request

curl --request GET \
     --url https://api.symbl.ai/v1/conversations/{CONVERSATION_ID}/entities \
     --header 'Accept: application/json' \
     --header 'Authorization: Bearer $AUTH_TOKEN'
const options = {
  method: 'GET',
  headers: {
    Accept: 'application/json',
    Authorization: 'Bearer $AUTH_TOKEN'
  }
};

fetch('https://api.symbl.ai/v1/conversations/{CONVERSATION_ID}/entities', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
import requests

url = "https://api.symbl.ai/v1/conversations/{CONVERSATION_ID}/entities"

headers = {
    "Accept": "application/json",
    "Authorization": "Bearer $AUTH_TOKEN"
}

response = requests.get(url, headers=headers)

print(response.text)

Entities response

{
  "entities": [
    {
      "type": "phonenum",
      "value": "5313526548660224",
      "text": "5313526548660224",
      "messageRefs": [
        {
          "id": "4701356739788800",
          "text": "5313526548660224.",
          "offset": 0
        }
      ]
    },
    {
      "type": "number",
      "value": "5313526548660224",
      "text": "5313526548660224",
      "messageRefs": [
        {
          "id": "4701356739788800",
          "text": "5313526548660224.",
          "offset": 0
        }
      ]
    }
  ]
}

Did this page help you?