To get a list of questions and nodes under Knowledge task.
To use this API, app needs the Admin API Scope of KnowlegdeGraph.
GET https://{{host}}/api/public/stream/{{streamId}}/faqs?ktId=&limit=&offset=&parentId=&withallchild=&type=&language=en
Path Parameters
Parameter | Required/Optional | Description |
---|---|---|
host | Required | Environment URL, for example, https://bots.kore.ai |
streamId | Required | Bot ID or Stream ID. You can access it from the General Settings page of the bot. |
Query Parameters
Parameter | Required/Optional | Description |
---|---|---|
ktId | Required | Knowledge task id from where the FAQs are required to be listed. |
limit | Optional | Number of records to be fetched, if not provided set to 50. |
offset | Optional | Number of records to be skipped, if not provided set to 0 |
parentId | Required | Parent id. |
withallchild | Optional | Whether child nodes need to be included |
type | Optional | Type of FAQs to be fetched. |
language | Required | The bot language, for example, “en” for English and “de” for German. |
Authorization
Invoke the API with JWT in the header with the following syntax:
auth: {{JWT}}
Response Content Type
application/json
Sample Request
curl -X POST \ https://{{host}}/api/public/stream/{{bot_id}}/faqs?ktId=5afxxxxxf&limit=30&offset=0&parentId=xxxxx-xxx-xxx-xxx-xxxxx&withallchild=true&type=all&language=en \ -H 'auth: {{YOUR_JWT_ACCESS_TOKEN}}' \ -H 'content-type: application/json'
Sample Response
{ "faqs": [ { "_id": "5e0ef00f41c79c0a7c3a729a", "subAnswers": [], "editLocked": false, "isPublished": true, "questionPayload": { "question": "What is Bank Internet Banking?", "tagsPayload": [] }, "answerPayload": [ { "_id": "mt-95deca18-9b2a-5c5e-970e-566ef678e270", "channel": "default", "streamId": "st-xxxxx-xxx-xxx-xxx-xxxxx", "lModBy": "u-xxxxx-xxx-xxx-xxx-xxxxx", "lMod": "Fri Jan 03 2020 13:11:03 GMT+0530 (India Standard Time)", "createdBy": "u-xxxxx-xxx-xxx-xxx-xxxxx", "createdOn": "Fri Jan 03 2020 13:11:03 GMT+0530 (India Standard Time)", "text": "Bank Internet banking is a convenient way to bank anytime, anywhere even from the comfort of your home using your PC or Tab.", "type": "basic" } ], "knowledgeTaskId": "5afa79639466e4369e3c809f", "subQuestions": [], "responseType": "message", "streamId": "st-xxxxx-xxx-xxx-xxx-xxxxx", "parent": "xxxxx-xxx-xxx-xxx-xxxxx", "leafterm": "yes", "language": "en", "createdBy": "u-xxxxx-xxx-xxx-xxx-xxxxx", "lastModifiedBy": "u-xxxxx-xxx-xxx-xxx-xxxxx", "createdOn": "2020-01-03T07:41:03.017Z", "modifiedOn": "2020-01-03T07:41:03.017Z", "sortId": 1578037263017, "botName": "BankingBot", "refId": "xxxxx-xxx-xxx-xxx-xxxxx", "__v": 0 }] }