Entities

GET /entities

Path

GET "https://api.botengine.ai/entities"

Example request

curl -X GET \
  https://api.botengine.ai/entities \
  -H 'authorization: Bearer ${DEVELOPER_ACCESS_TOKEN}'

Example response

[
  {
    "id": "58ee1a4b5fb5580005cb819e",
    "entries": [
      {
        "synonyms": [
          {
            "value": "demo"
          },
          {
            "value": "demonstration"
          }
        ],
        "value": "demo"
      }
    ],
    "name": "example"
  }
]

Returns list of all entities.

GET /entities/:id

Path

GET "https://api.botengine.ai/entities/:id"

Example request

curl -X GET \
  https://api.botengine.ai/entities/58ee1a4b5fb5580005cb819e \
  -H 'authorization: Bearer ${DEVELOPER_ACCESS_TOKEN}'

Example response

{
  "id": "58ee1a4b5fb5580005cb819e",
  "entries": [
    {
      "synonyms": [
        {
          "value": "demo"
        },
        {
          "value": "demonstration"
        }
      ],
      "value": "demo"
    }
  ],
  "name": "example"
}

Returns single entity for the given id.

POST /entities

Path

POST "https://api.botengine.ai/entities"

Important! Synonyms in Entities must contain the main value. Take a look at the example request below - the main value New York also occurs in synonyms.

Example request

curl -X POST \
  https://api.botengine.ai/entities \
  -H 'authorization: Bearer ${DEVELOPER_ACCESS_TOKEN}' \
  -H 'content-type: application/json' \
  -d '{
    "name": "city",
    "entries": [
        {
            "value": "New York",
            "synonyms": [
                {
                    "value": "New York"
                },
                {
                    "value": "New York City"
                },
                {
                    "value": "NYC"
                }
            ]
        }
    ]
}'

Example response

{
  "id": "58ee1e395d033800059a3f6f",
  "timestamp": "2017-04-12T12:31:53.083Z",
  "status": {
    "code": 200,
    "errorType": "success"
  }
}

Creates a new entity.

Required parameters

Property Type Description
name String Entity name
Max: 128
entries Array.<Object> Entity entries
Array max size: 2000
entries.value String Entry value
Max: 1024
entries.synonyms Array.<Object> Entry synonyms
Array max size: 1 - 99
entries.synonyms.value String Synonym value
Min: 1
Max: 1024

Body

{
    "name": "city",
    "entries": [
        {
            "value": "New York",
            "synonyms": [
                {
                    "value": "New York"
                },
                {
                    "value": "New York City"
                },
                {
                    "value": "NYC"
                }
            ]
        }
    ]
}

PUT /entities/:id

Path

PUT "https://api.botengine.ai/entities/:id"

Example request

curl -X PUT \
  https://api.botengine.ai/entities/58ee1e395d033800059a3f6f \
  -H 'authorization: Bearer ${DEVELOPER_ACCESS_TOKEN}' \
  -H 'content-type: application/json' \
  -d '{
    "name": "city",
    "entries": [
        {
            "value": "New York",
            "synonyms": [
                {
                  "value": "New York"
                },
                {
                  "value": "New York City"
                },
                {
                  "value": "NYC"
                }
              ]
        },
        {
            "value": "Los Angeles",
            "synonyms": [
                {
                  "value": "Los Angeles"
                },
                {
                  "value": "LA"
                }
            ]
        }
    ]
}'

Example response

{
  "timestamp": "2017-04-12T12:35:06.480Z",
  "status": {
    "code": 200,
    "errorType": "success"
  }
}

Update entity with the given id.

Required parameters

Property Type Description
name String Entity name
Max: 128
entries Array.<Object> Entity entries
Array max size: 2000
entries.value String Entry value
Max: 1024
entries.synonyms Array.<Object> Entry synonyms
Array max size: 1 - 99
entries.synonyms.value String Synonym value
Min: 1
Max: 1024

Body

{
    "name": "city",
    "entries": [
        {
            "value": "New York",
            "synonyms": [
                {
                  "value": "New York"
                },
                {
                  "value": "New York City"
                },
                {
                  "value": "NYC"
                }
              ]
        },
        {
            "value": "Los Angeles",
            "synonyms": [
                {
                  "value": "Los Angeles"
                },
                {
                  "value": "LA"
                }
            ]
        }
    ]
}

DEL /entities:id

Path

DELETE "https://api.botengine.ai/entities/:id"

Example request

curl -X DELETE \
  https://api.botengine.ai/entities/58ee1e395d033800059a3f6f \
  -H 'authorization: Bearer ${DEVELOPER_ACCESS_TOKEN}'

Example response

{
  "timestamp": "2017-04-12T12:38:14.112Z",
  "status": {
    "code": 200,
    "errorType": "success"
  }
}

Removes a entity with the given id.