{"id":24630,"date":"2020-09-28T08:18:43","date_gmt":"2020-09-28T07:18:43","guid":{"rendered":"https:\/\/developer.kore.ai\/v7-3\/?p=24630"},"modified":"2020-09-28T08:18:43","modified_gmt":"2020-09-28T07:18:43","slug":"get-faqs-kg","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v7-3\/docs\/bots\/api-guide\/get-faqs-kg\/","title":{"rendered":"Get FAQs &#8211; KG"},"content":{"rendered":"<section class=\"l-section wpb_row height_auto\"><div class=\"l-section-h i-cf\"><div class=\"g-cols vc_row type_default valign_top\"><div class=\"vc_col-sm-12 wpb_column vc_column_container\"><div class=\"vc_column-inner\"><div class=\"wpb_wrapper\">\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<p> To get a list of questions and nodes under Knowledge task.<\/p>\n<p class=\"note\">To use this API, app needs the Admin API Scope of <em>KnowlegdeGraph<\/em>.<\/p>\n<p><b>GET<\/b> <code>https:\/\/{{host}}\/api\/public\/stream\/{{streamId}}\/faqs?ktId=&amp;limit=&amp;offset=&amp;parentId=&amp;withallchild=&amp;type=&amp;language=en<\/code><\/p>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h3><span class=\"ez-toc-section\" id=\"Path_Parameters\">Path Parameters<\/span><\/h3>\n<table>\n<tbody>\n<tr>\n<th><b>Parameter<\/b><\/th>\n<th><b>Required\/Optional<\/b><\/th>\n<th><b>Description<\/b><\/th>\n<\/tr>\n<tr>\n<td>host<\/td>\n<td>Required<\/td>\n<td>Environment URL, for example, https:\/\/bots.kore.ai<\/td>\n<\/tr>\n<tr>\n<td>streamId<\/td>\n<td>Required<\/td>\n<td>Bot ID or Stream ID. You can access it from the General Settings page of the bot.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h3><span class=\"ez-toc-section\" id=\"Query_Parameters\">Query Parameters<\/span><\/h3>\n<table>\n<tbody>\n<tr>\n<th><b>Parameter<\/b><\/th>\n<th><b>Required\/Optional<\/b><\/th>\n<th><b>Description<\/b><\/th>\n<\/tr>\n<tr>\n<td>ktId<\/td>\n<td>Required<\/td>\n<td>Knowledge task id from where the FAQs are required to be listed.<\/td>\n<\/tr>\n<tr>\n<td>limit<\/td>\n<td>Optional<\/td>\n<td>Number of records to be fetched, if not provided set to 50.<\/td>\n<\/tr>\n<tr>\n<td>offset<\/td>\n<td>Optional<\/td>\n<td>Number of records to be skipped, if not provided set to 0<\/td>\n<\/tr>\n<tr>\n<td>parentId<\/td>\n<td>Required<\/td>\n<td>Parent id.<\/td>\n<\/tr>\n<tr>\n<td>withallchild<\/td>\n<td>Optional<\/td>\n<td>Whether child nodes need to be included<\/td>\n<\/tr>\n<tr>\n<td>type<\/td>\n<td>Optional<\/td>\n<td>Type of FAQs to be fetched.<\/td>\n<\/tr>\n<tr>\n<td>language<\/td>\n<td>Required<\/td>\n<td>The bot language, for example, \u201cen\u201d for English and \u201cde\u201d for German.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h3><span class=\"ez-toc-section\" id=\"Authorization\">Authorization<\/span><\/h3>\n<p>Invoke the API with JWT in the header with the following syntax:<\/p>\n<p><code>auth: {{JWT}}<\/code><\/p>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h3><span class=\"ez-toc-section\" id=\"Response_Content_Type\">Response Content Type<\/span><\/h3>\n<p><code>application\/json<\/code><\/p>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h3><span class=\"ez-toc-section\" id=\"Sample_Request\">Sample Request<\/span><\/h3>\n<pre>curl -X POST \\\r\n  https:\/\/{{host}}\/api\/public\/stream\/{{bot_id}}\/faqs?ktId=5afxxxxxf&amp;limit=30&amp;offset=0&amp;parentId=xxxxx-xxx-xxx-xxx-xxxxx&amp;withallchild=true&amp;type=all&amp;language=en \\\r\n  -H 'auth: {{YOUR_JWT_ACCESS_TOKEN}}' \\\r\n  -H 'content-type: application\/json' \r\n<\/pre>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h3><span class=\"ez-toc-section\" id=\"Sample_Response\">Sample Response<\/span><\/h3>\n<pre>{\r\n    \"faqs\": [\r\n        {\r\n            \"_id\": \"5e0ef00f41c79c0a7c3a729a\",\r\n            \"subAnswers\": [],\r\n            \"editLocked\": false,\r\n            \"isPublished\": true,\r\n            \"questionPayload\": {\r\n                \"question\": \"What is Bank Internet Banking?\",\r\n                \"tagsPayload\": []\r\n            },\r\n            \"answerPayload\": [\r\n                {\r\n                    \"_id\": \"mt-95deca18-9b2a-5c5e-970e-566ef678e270\",\r\n                    \"channel\": \"default\",\r\n                    \"streamId\": \"st-xxxxx-xxx-xxx-xxx-xxxxx\",\r\n                    \"lModBy\": \"u-xxxxx-xxx-xxx-xxx-xxxxx\",\r\n                    \"lMod\": \"Fri Jan 03 2020 13:11:03 GMT+0530 (India Standard Time)\",\r\n                    \"createdBy\": \"u-xxxxx-xxx-xxx-xxx-xxxxx\",\r\n                    \"createdOn\": \"Fri Jan 03 2020 13:11:03 GMT+0530 (India Standard Time)\",\r\n                    \"text\": \"Bank Internet banking is a convenient way to bank anytime, anywhere even from the comfort of your home using your PC or Tab.\",\r\n                    \"type\": \"basic\"\r\n                }\r\n            ],\r\n            \"knowledgeTaskId\": \"5afa79639466e4369e3c809f\",\r\n            \"subQuestions\": [],\r\n            \"responseType\": \"message\",\r\n            \"streamId\": \"st-xxxxx-xxx-xxx-xxx-xxxxx\",\r\n            \"parent\": \"xxxxx-xxx-xxx-xxx-xxxxx\",\r\n            \"leafterm\": \"yes\",\r\n            \"language\": \"en\",\r\n            \"createdBy\": \"u-xxxxx-xxx-xxx-xxx-xxxxx\",\r\n            \"lastModifiedBy\": \"u-xxxxx-xxx-xxx-xxx-xxxxx\",\r\n            \"createdOn\": \"2020-01-03T07:41:03.017Z\",\r\n            \"modifiedOn\": \"2020-01-03T07:41:03.017Z\",\r\n            \"sortId\": 1578037263017,\r\n            \"botName\": \"BankingBot\",\r\n            \"refId\": \"xxxxx-xxx-xxx-xxx-xxxxx\",\r\n            \"__v\": 0\r\n        }]\r\n}\r\n<\/pre>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div><\/div><\/div><\/div><\/div><\/div><\/section>\n","protected":false},"excerpt":{"rendered":"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=&amp;limit=&amp;offset=&amp;parentId=&amp;withallchild=&amp;type=&amp;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...","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[],"class_list":["post-24630","post","type-post","status-publish","format-standard","hentry","category-api-guide"],"_links":{"self":[{"href":"https:\/\/developer.kore.ai\/v7-3\/wp-json\/wp\/v2\/posts\/24630","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.kore.ai\/v7-3\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.kore.ai\/v7-3\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v7-3\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v7-3\/wp-json\/wp\/v2\/comments?post=24630"}],"version-history":[{"count":1,"href":"https:\/\/developer.kore.ai\/v7-3\/wp-json\/wp\/v2\/posts\/24630\/revisions"}],"predecessor-version":[{"id":24631,"href":"https:\/\/developer.kore.ai\/v7-3\/wp-json\/wp\/v2\/posts\/24630\/revisions\/24631"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v7-3\/wp-json\/wp\/v2\/media?parent=24630"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v7-3\/wp-json\/wp\/v2\/categories?post=24630"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v7-3\/wp-json\/wp\/v2\/tags?post=24630"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}