{"id":22977,"date":"2019-12-10T10:01:52","date_gmt":"2019-12-10T10:01:52","guid":{"rendered":"https:\/\/developer.kore.ai\/v9-1\/?p=22977"},"modified":"2021-11-25T08:09:04","modified_gmt":"2021-11-25T08:09:04","slug":"get-widget","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v9-1\/docs\/bots\/api-guide\/get-widget\/","title":{"rendered":"Get Dashboard Widget Data"},"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 the data result of a widget from a specific Custom Dashboard added to a bot.<\/p>\n<p class=\"note\">To use this API, app needs the Bot Builder API scope of <em>Custom Reports<\/em>.<\/p>\n<p><b>GET <\/b><code>https:\/\/{{host}}\/api\/public\/bot\/{{BotID}}\/dashboard\/{{dashboardName}}\/widget\/{{widgetName}}?startDate={{startDate}}&amp;endDate={{endDate}}&amp;limit=-1<\/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>BotID<\/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<tr>\n<td>dashboardName<\/td>\n<td>Required<\/td>\n<td>Name of the Custom Dashboard containing the required Widget.<\/td>\n<\/tr>\n<tr>\n<td>widgetName<\/td>\n<td>Required<\/td>\n<td>Name of the Widget whose data needs to be retrieved.<\/td>\n<\/tr>\n<tr>\n<td>limit<\/td>\n<td>Optional<\/td>\n<td>The number of records to fetch. The maximum applicable limit is 50.<\/td>\n<\/tr>\n<tr>\n<td>startDate<\/td>\n<td>Required<\/td>\n<td>The start date from which you want to see the changes. Enter the date in ISO date format. For example,\u00a0March 30, 2020 would be 2020-03-30.<\/td>\n<\/tr>\n<tr>\n<td>endDate<\/td>\n<td>Required<\/td>\n<td>The end date up to which you want to see the changes.\u00a0Enter the date in ISO date format. For example,\u00a0March 30, 2020 would be 2020-03-30.<\/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 GET \\\r\n  https:\/\/{{host}}\/api\/public\/bot\/{{bot_id}}\/dashboard\/{{dashboardName}}\/widget\/{{widgetName}}?startDate={{startDate}}&amp;endDate={{endDate}} \\\r\n  -H 'auth: {{YOUR_JWT_ACCESS_TOKEN}}' \\\r\n  -H 'content-type: application\/json' \\<\/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    \"_id\": \"wg-xxxx-xxx-xxx-xxx-xxxxx\",\r\n    \"overlay\": [],\r\n    \"name\": \"dasaDSA\",\r\n    \"type\": \"table\",\r\n    \"sqlQuery\": {\r\n        \"dataSet\": \"Analytics\",\r\n        \"select\": \"metricType\",\r\n        \"startDate\": \"2019-08-31T18:30:00.000Z\",\r\n        \"endDate\": \"2019-10-01T18:30:00.000Z\",\r\n        \"botId\": \"st-xxxxx-xxx-xxx-xxx-xxxxx\"\r\n    },\r\n    \"dimensions\": [\r\n           {\r\n            \"fieldName\": \"metricType\",\r\n            \"displayName\": \"metricType\",\r\n            \"type\": \"string\"\r\n        }\r\n    ],\r\n    \"metrics\": [],\r\n    \"row\": [],\r\n    \"properties\": {},\r\n    \"queryResponse\": {\r\n        \"metaData\": {\r\n            \"metricType\": \"string\"\r\n        },\r\n        \"queryResponse\": [\r\n            {\r\n                \"metricType\": \"successintents\"\r\n            },\r\n            {\r\n                \"metricType\": \"successtasks\"\r\n            },\r\n            {\r\n                \"metricType\": \"successintents\"\r\n            },\r\n            {\r\n                \"metricType\": \"successintents\"\r\n            },\r\n            {\r\n                \"metricType\": \"successtasks\"\r\n            },\r\n            {\r\n                \"metricType\": \"failedintents\"\r\n            }\r\n        ]\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 the data result of a widget from a specific Custom Dashboard added to a bot. To use this API, app needs the Bot Builder API scope of Custom Reports. GET https:\/\/{{host}}\/api\/public\/bot\/{{BotID}}\/dashboard\/{{dashboardName}}\/widget\/{{widgetName}}?startDate={{startDate}}&amp;endDate={{endDate}}&amp;limit=-1 Path Parameters Parameter Required\/Optional Description host Required Environment URL, for example, https:\/\/bots.kore.ai BotID Required Bot ID or Stream ID. You can access...","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-22977","post","type-post","status-publish","format-standard","hentry","category-api-guide"],"_links":{"self":[{"href":"https:\/\/developer.kore.ai\/v9-1\/wp-json\/wp\/v2\/posts\/22977","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.kore.ai\/v9-1\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.kore.ai\/v9-1\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v9-1\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v9-1\/wp-json\/wp\/v2\/comments?post=22977"}],"version-history":[{"count":12,"href":"https:\/\/developer.kore.ai\/v9-1\/wp-json\/wp\/v2\/posts\/22977\/revisions"}],"predecessor-version":[{"id":31981,"href":"https:\/\/developer.kore.ai\/v9-1\/wp-json\/wp\/v2\/posts\/22977\/revisions\/31981"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v9-1\/wp-json\/wp\/v2\/media?parent=22977"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v9-1\/wp-json\/wp\/v2\/categories?post=22977"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v9-1\/wp-json\/wp\/v2\/tags?post=22977"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}