{"id":24919,"date":"2020-10-31T08:43:33","date_gmt":"2020-10-31T08:43:33","guid":{"rendered":"https:\/\/developer.kore.ai\/v10-1\/?p=24919"},"modified":"2023-12-08T08:16:44","modified_gmt":"2023-12-08T08:16:44","slug":"user-engagement-trend-api","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v10-1\/docs\/bots\/api-guide\/user-engagement-trend-api\/","title":{"rendered":"User Engagement Trend API"},"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 provide the number of users who have interacted with the bot in a given period across different time intervals.<\/p>\n<table>\n<tbody>\n<tr>\n<td><strong>Method<\/strong><\/td>\n<td>POST<\/td>\n<\/tr>\n<tr>\n<td><strong>Endpoint<\/strong><\/td>\n<td><code>https:\/\/{{host}}\/api\/public\/bot\/{{BotID}}\/userEngagementTrend?aggregation_type={{type}}&amp;start_date={{from}}&amp;end_date={{to}}&amp;channels={{channel}}<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>Content Type<\/strong><\/td>\n<td><code>application\/json<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>Authorization<\/strong><\/td>\n<td><code>auth: {{JWT}}<\/code><\/p>\n<p>See <a href=\"https:\/\/developer.kore.ai\/v10-1\/docs\/bots\/api-guide\/apis\/#Generating_the_JWT_Token\" target=\"_blank\" rel=\"noopener noreferrer\">How to generate the JWT Token.<\/a><\/td>\n<\/tr>\n<tr>\n<td><strong>API Scope<\/strong><\/td>\n<td>\n<ul>\n<li>Bot Builder: User Engagement Trend<\/li>\n<li>Admin Console: Not Applicable<\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"ult-spacer spacer-6ae8707626bcd\" data-id=\"6ae8707626bcd\" data-height=\"10\" data-height-mobile=\"10\" data-height-tab=\"10\" data-height-tab-portrait=\"\" data-height-mobile-landscape=\"\" style=\"clear:both;display:block;\"><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h2><span class=\"ez-toc-section\" id=\"Path_Parameters\">Path Parameters<\/span><\/h2>\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<\/tbody>\n<\/table>\n<pre><\/pre>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"ult-spacer spacer-6ae8707626d0b\" data-id=\"6ae8707626d0b\" data-height=\"10\" data-height-mobile=\"10\" data-height-tab=\"10\" data-height-tab-portrait=\"\" data-height-mobile-landscape=\"\" style=\"clear:both;display:block;\"><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h2><span class=\"ez-toc-section\" id=\"Query_Parameters\">Query Parameters<\/span><\/h2>\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>filters<\/td>\n<td>Required<\/td>\n<td>Object with the following details to filter the result set<\/td>\n<\/tr>\n<tr>\n<td>start_date<\/td>\n<td>Required<\/td>\n<td>Refers to the start time of the period to be considered.<\/td>\n<\/tr>\n<tr>\n<td>end_date<\/td>\n<td>Required<\/td>\n<td>Refers to the end time of the period to be considered.<\/td>\n<\/tr>\n<tr>\n<td>channel<\/td>\n<td>Optional<\/td>\n<td>Refers to the channel from which the interactions have happened.<\/td>\n<\/tr>\n<tr>\n<td>aggregation_type<\/td>\n<td>Optional<\/td>\n<td>Refers to the type of aggregation to be allowed, possible values are:<\/p>\n<ul>\n<li>Hourly (Default)<\/li>\n<li>Daily<\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"ult-spacer spacer-6ae8707626ebe\" data-id=\"6ae8707626ebe\" data-height=\"10\" data-height-mobile=\"10\" data-height-tab=\"10\" data-height-tab-portrait=\"\" data-height-mobile-landscape=\"\" style=\"clear:both;display:block;\"><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h2><span class=\"ez-toc-section\" id=\"Sample_Request\">Sample Request<\/span><\/h2>\n<pre>curl --location --request POST 'https:\/\/bots.kore.ai\/api\/public\/bot\/st-61a3723a-3597-57c4-xxxx-2953xxxxd\/userEngagementTrend?aggregation_type=Daily&amp;start_date=2023-12-06&amp;end_date=2023-12-07&amp;channels=rtm' \\\r\n--header 'auth: {{YOUR_JWT_ACCESS_TOKEN}}' \\\r\n--header 'content-type: application\/json'<\/pre>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"ult-spacer spacer-6ae8707626f3d\" data-id=\"6ae8707626f3d\" data-height=\"10\" data-height-mobile=\"10\" data-height-tab=\"10\" data-height-tab-portrait=\"\" data-height-mobile-landscape=\"\" style=\"clear:both;display:block;\"><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h2><span class=\"ez-toc-section\" id=\"Sample_Response\">Sample Response<\/span><\/h2>\n<ul>\n<li><strong>when aggregation_type = Daily<\/strong>\n<pre>{\r\n  \"results\":[\r\n     { \r\n         \"date\": \"MMM DD YYYY\",\r\n         \"users\": \u201cNumber of users\u201d\r\n      },\r\n     { \r\n         \"date\": \"MMM DD YYYY\",\r\n         \"users\": \u201cNumber of users\u201d\r\n      }\r\n     ],\r\n  \"totalResults\": 2\r\n }<\/pre>\n<\/li>\n<li><strong>when aggregation_type = Hourly or empty or not given<\/strong>\n<pre>{\r\n   \"results\": [\r\n      {\r\n           \"date\": \"Aug 06 2020\",\r\n           \"0 - 1\": 20,\r\n           \"1 - 2\": 0,\r\n           \"2 - 3\": 0,\r\n           \"3 - 4\": 10,\r\n           \"4 - 5\": 5,\r\n           \"5 - 6\": 5,\r\n           \"6 - 7\": 5,\r\n           \"7 - 8\": 3,\r\n           \"8 - 9\": 6,\r\n           \"9 - 10\": 5,\r\n           \"10 - 11\": 1,\r\n           \"11 - 12\": 1,\r\n           \"12 - 13\": 0,\r\n           \"13 - 14\": 0,\r\n           \"14 - 15\": 0,\r\n           \"15 - 16\": 0,\r\n           \"16 - 17\": 0,\r\n           \"17 - 18\": 0,\r\n           \"18 - 19\": 0,\r\n           \"19 - 20\": 0,\r\n           \"20 - 21\": 0,\r\n           \"21 - 22\": 0,\r\n           \"22 - 23\": 0,\r\n           \"23 - 0\": 0\r\n     },\r\n     {\r\n           \"date\": \"Aug 07 2020\",\r\n           \"0 - 1\": 20,\r\n           \"1 - 2\": 0,\r\n           \"2 - 3\": 0,\r\n           \"3 - 4\": 10,\r\n           \"4 - 5\": 0,\r\n           \"5 - 6\": 5,\r\n           \"6 - 7\": 6,\r\n           \"7 - 8\": 4,\r\n           \"8 - 9\": 8,\r\n           \"9 - 10\": 7,\r\n           \"10 - 11\": 4,\r\n           \"11 - 12\": 4,\r\n           \"12 - 13\": 0,\r\n           \"13 - 14\": 0,\r\n           \"14 - 15\": 0,\r\n           \"15 - 16\": 0,\r\n           \"16 - 17\": 0,\r\n           \"17 - 18\": 0,\r\n           \"18 - 19\": 0,\r\n           \"19 - 20\": 0,\r\n           \"20 - 21\": 0,\r\n           \"21 - 22\": 0,\r\n           \"22 - 23\": 0,\r\n           \"23 - 0\": 0\r\n     }\r\n],\r\n  \"totalResults\": 2\r\n }<\/pre>\n<p>&nbsp;<\/li>\n<\/ul>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<\/div><\/div><\/div><\/div><\/div><\/section><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\"><div class=\"w-separator size_medium\"><\/div><\/div><\/div><\/div><\/div><\/div><\/section><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\"><\/div><\/div><\/div><\/div><\/div><\/section>\n","protected":false},"excerpt":{"rendered":"To provide the number of users who have interacted with the bot in a given period across different time intervals. Method POST Endpoint https:\/\/{{host}}\/api\/public\/bot\/{{BotID}}\/userEngagementTrend?aggregation_type={{type}}&amp;start_date={{from}}&amp;end_date={{to}}&amp;channels={{channel}} Content Type application\/json Authorization auth: {{JWT}} See How to generate the JWT Token. API Scope Bot Builder: User Engagement Trend Admin Console: Not Applicable Path Parameters Parameter Required\/Optional Description host Required...","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-24919","post","type-post","status-publish","format-standard","hentry","category-api-guide"],"_links":{"self":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/24919","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/comments?post=24919"}],"version-history":[{"count":16,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/24919\/revisions"}],"predecessor-version":[{"id":60528,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/24919\/revisions\/60528"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/media?parent=24919"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/categories?post=24919"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/tags?post=24919"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}