{"id":24919,"date":"2020-10-31T08:43:33","date_gmt":"2020-10-31T08:43:33","guid":{"rendered":"https:\/\/developer.kore.ai\/v8-1\/?p=24919"},"modified":"2021-03-18T11:41:35","modified_gmt":"2021-03-18T11:41:35","slug":"user-engagement-trend-api","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v8-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<p class=\"note\">To use this API, the app needs the <em>Bot Scope<\/em>.<\/p>\n<p><b>POST <\/b><code>https:\/\/{{host}}\/api\/public\/bot\/{{BotID}}\/userEngagementTrend?aggregation_type={{type}}&amp;start_date={{from}}&amp;end_date={{to}}&amp;channels={{channel}}<\/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<\/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<h3><span class=\"ez-toc-section\" id=\"Query_Parameters\">Query Parameters<\/span><\/h3>\n<p>&nbsp;<\/p>\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=\"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\/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<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<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 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 provide the number of users who have interacted with the bot in a given period across different time intervals. To use this API, the app needs the Bot Scope. POST https:\/\/{{host}}\/api\/public\/bot\/{{BotID}}\/userEngagementTrend?aggregation_type={{type}}&amp;start_date={{from}}&amp;end_date={{to}}&amp;channels={{channel}} 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 it...","protected":false},"author":14,"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\/v8-1\/wp-json\/wp\/v2\/posts\/24919","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/users\/14"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/comments?post=24919"}],"version-history":[{"count":1,"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/posts\/24919\/revisions"}],"predecessor-version":[{"id":24920,"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/posts\/24919\/revisions\/24920"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/media?parent=24919"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/categories?post=24919"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/tags?post=24919"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}