Update

HTTP Request

PUT https://api.botfuel.io/trainer/api/v0/qnas/<qna:id>

Request Structure

Parameter Type Description Required
utterances Array Array of phrases and questions to trigger this QnA Optional
title String Given title for this QnA Required
resolvePrompt String Text displayed to user when bot identifies several QnAs or Intents Optional
answers Array Array of possible bot answers to the question asked by user Optional

Response structure

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 -d '{
  "utterances": [
     {
       "value": "First way of triggering this Qna"
     },
     {
       "value": "Second way of triggering this Qna"
     }
  ],
  "title": "The title of this new QnA",
  "resolvePrompt": "that you want to create a QnA",
  "answers": [[ {
         "type": "text",
         "payload": {
           "value": "an answer message."
         }
       }]  
  ]
}' \
-H "App-Id: $BOTFUEL_APP_ID" \
-H "App-Key: $BOTFUEL_APP_KEY" \
-H "Content-Type: application/json" \
-X PUT 'https://api.botfuel.io/trainer/api/v0/qnas/<qna:id>'
// Response
{
  "qna": {
    "answers": [
      [
        {
          "payload": {
            "value": "an answer message."
          },
          "type": "text"
        }
      ]
    ],
    "id": "5b4f5e458514c54ee49a2f20",
    "resolvePrompt": "that you want to create a QnA",
    "title": "The title of this new QnA",
    "trainingScore": null,
    "utterances": [
      {
        "value": "First way of triggering this Qna"
      },
      {
        "value": "Second way of triggering this Qna"
      }
    ]
  }
}