{"id":24919,"date":"2020-10-31T08:43:33","date_gmt":"2020-10-31T08:43:33","guid":{"rendered":"https:\/\/developer.kore.ai\/v9-3\/?p=24919"},"modified":"2022-12-01T12:41:29","modified_gmt":"2022-12-01T12:41:29","slug":"user-engagement-trend-api","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v9-3\/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>\n<p><code>auth: {{JWT}}<\/code><\/p>\n<p>See <a href=\"https:\/\/developer.kore.ai\/v9-3\/docs\/bots\/api-guide\/apis\/#Generating_the_JWT_Token\" rel=\"noopener noreferrer\" target=\"_blank\">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\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<p>&nbsp;<\/p>\n<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<p>&nbsp;<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Sample_Request\">Sample Request<\/span><\/h2>\n<pre>curl -X POST \\\r\n  'https:\/\/{{host}}\/api\/public\/bot\/{{bot_id}}\/userEngagementTrend?aggregation_type=Hourly&amp;start_date=2020-09-01&amp;end_date=2020-09-05&amp;channels=rtm '\\\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\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<p>&nbsp;<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Body_Parameters\">Body 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>\n<p>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\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<p>&nbsp;<\/p>\n<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     { date: \"MMM DD YYYY\",\r\n       users: \u201cnumber of users\u201d\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 [\r\n   results:{\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\": 0,\r\n       ..\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       ..\r\n       \"21 - 22\": 0,\r\n       \"22 - 23\": 0,\r\n       \"23 - 0\": 0\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>\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 &nbsp; Path Parameters Parameter Required\/Optional Description host...","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\/v9-3\/wp-json\/wp\/v2\/posts\/24919","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.kore.ai\/v9-3\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.kore.ai\/v9-3\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v9-3\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v9-3\/wp-json\/wp\/v2\/comments?post=24919"}],"version-history":[{"count":7,"href":"https:\/\/developer.kore.ai\/v9-3\/wp-json\/wp\/v2\/posts\/24919\/revisions"}],"predecessor-version":[{"id":49497,"href":"https:\/\/developer.kore.ai\/v9-3\/wp-json\/wp\/v2\/posts\/24919\/revisions\/49497"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v9-3\/wp-json\/wp\/v2\/media?parent=24919"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v9-3\/wp-json\/wp\/v2\/categories?post=24919"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v9-3\/wp-json\/wp\/v2\/tags?post=24919"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}