Read All

HTTP Request

GET https://api.botfuel.io/trainer/api/v0/qnas

Response structure

The response structure has three components: "_content", "_count" and "_links". "_count" and "_links" are purely used for pagination, while "_content" has the information on the QnA's for the bot. The following parameters are from the "_content" component.

Parameter Type Description
answers Array Array of possible bot answers to the question asked by user
id String Unique identifier for this QnA
resolvePrompt String Text displayed to user when bot identifies several QnAs or Intents
title String Given title for this QnA
trainingScore Integer Integer between 0 and 1 representing how well-trained the QnA is
utterances Array Array of phrases and questions to trigger this QnA

Example

curl -H "App-Id: $BOTFUEL_APP_ID" \
-H "App-Key: $BOTFUEL_APP_KEY" \
-X GET 'https://api.botfuel.io/trainer/api/v0/qnas'
// Response
{
  "_content": [
    {
      "answers": [
        [
          {
            "payload": {
              "value": "an answer message."
            },
            "type": "text"
          }
        ]
      ],
      "id": "5b55981fe44b330012882a5e",
      "resolvePrompt": "that you want to create a QnA",
      "title": "The tile of this new QnA",
      "trainingScore": 1,
      "utterances": [
        {
          "value": "First way of triggering this Qna"
        },
        {
          "value": "Second way of triggering this Qna"
        }
      ]
    }
  ],
  "_count": {
    "elements": 1,
    "pages": 1
  },
  "_links": {
    "hasNext": false,
    "hasPrevious": false,
    "next": null,
    "previous": null,
    "self": "api/v0/qnas"
  }
}