{"id":41278,"date":"2022-04-21T09:00:10","date_gmt":"2022-04-21T08:00:10","guid":{"rendered":"https:\/\/developer.kore.ai\/v10-1\/?p=41278"},"modified":"2022-04-21T09:00:39","modified_gmt":"2022-04-21T08:00:39","slug":"sessions-api","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v10-1\/docs\/bots\/api-guide\/sessions-api\/?lang=ko","title":{"rendered":"\uc138\uc158 \uc774\ub825 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><span style=\"font-weight: 400\">This API retrieves the conversation sessions create<\/span><span style=\"font-weight: 400\">d. The API details are available in the Bot Builder and Bot Admin Console (BAC) app scopes.<\/span><\/p>\n<p class=\"note\">To use this API, app needs the Bot Builder API scope of <em>Bot sessions<\/em>.<br \/>\nOR the Admin API Scope of <em>Bot sessions<\/em> under <em>Bot Analytics<\/em>.<\/p>\n<p><strong>POST<\/strong>\u00a0<code>https:\/\/{{host}}\/api\/public\/bot\/{{BotID}}\/getSessions?containmentType={{containmentType}}<\/code><br \/>\nand <code>https:\/\/{{host}}\/api\/public\/getSessions?containmentType={{containmentType}}<\/code> for BAC.<\/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=\"Query_Parameters\">Query Parameters<\/span><\/h3>\n<table>\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Description<\/th>\n<\/tr>\n<tr>\n<td>\n<p>containmentType<\/p>\n<p>(introduced in ver9.0)<\/td>\n<td>Use to filter the results based on the type of the session i.e Self-service vs. Drop-off vs. Agent Transfer<br \/>\nValid values:<\/p>\n<ul>\n<li>dropOff,<\/li>\n<li>Selfservice,<\/li>\n<li>agent.<\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<\/thead>\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=\"Body_Parameters\">Body Parameters<\/span><\/h3>\n<table>\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Description<\/th>\n<\/tr>\n<tr>\n<td>userId (optional)<\/td>\n<td>The ID of the user whose conversation history to access. Can be a user email id or enterprise assigned unique id.<\/td>\n<\/tr>\n<tr>\n<td>skip\/offset (optional)<\/td>\n<td>The number of messages to be skipped.<\/td>\n<\/tr>\n<tr>\n<td>limit (optional)<\/td>\n<td>The number of messages to be shown on each page.<\/td>\n<\/tr>\n<tr>\n<td>dateFrom (optional)<\/td>\n<td>Takes the date format yyyy-mm-dd<br \/>\n(or) yyyy-mm-ddThh:mm:ss.msZ<br \/>\neg:2019-04-01 (or) 2019-04-01T13:25:58.515Z. If not provided, calculated as 7 days behind <em>dataTo<\/em>.<\/td>\n<\/tr>\n<tr>\n<td>dateTo (optional)<\/td>\n<td>Takes the date format yyyy-mm-dd<br \/>\n(or) yyyy-mm-ddThh:mm:ss.msZ<br \/>\neg:2019-04-01 (or) 2019-04-01 T13:26:05.598Z. If not provided, calculated as 7 days from <em>dateFrom<\/em>. If <em>dateFrom<\/em> is also not provided then set to <strong>Today<\/strong>.<\/td>\n<\/tr>\n<tr>\n<td>tags (optional)<\/td>\n<td>Meta tags to filter the conversations.<\/td>\n<\/tr>\n<tr>\n<td>sessionType (optional)<br \/>\n(introduced in ver8.0)<\/td>\n<td>\n<p>Type to filter the conversations &#8211; can be:<\/p>\n<ul>\n<li>non-interactive &#8211; sessions that have bot messages presented without any message from the user<\/li>\n<li>interactive &#8211; sessions that include one or more messages from the user<\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<\/thead>\n<\/table>\n<p><strong>Note<\/strong>: The duration between <em>dateTo<\/em> and <em>dateFrom<\/em> should be less than 7 days, else an error will be thrown.<\/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=\"i\">\uad8c\ud55c \ubd80\uc5ec<\/span><\/h3>\n<p>\ub2e4\uc74c \uad6c\ubb38\uc744 \ud3ec\ud568\ud55c \ud5e4\ub354\uc5d0 JWT\ub97c \ud3ec\ud568\ud55c API\ub97c \ud638\ucd9c\ud569\ub2c8\ub2e4. <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=\"i-2\">\ucf58\ud150\uce20 \uc720\ud615 \uc751\ub2f5<\/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=\"i-3\">\uc0d8\ud50c \uc694\uccad<\/span><\/h3>\n<ul>\n<li>\ubcf8\ubb38 \uc5c6\uc74c\n<pre class=\"\">curl --location --request POST '{{host}}\/api\/public\/getSessions?containmentType={{containmentType}}' \\\r\n     --header 'auth: {{YOUR_JWT_ACCESS_TOKEN}}' \\\r\n     --header 'Content-Type: application\/json' \\\r\n     --data-raw ''<\/pre>\n<\/li>\n<li>\ubcf8\ubb38 \ud3ec\ud568\n<pre class=\"\">curl --location --request POST '{{host}}\/api\/public\/bot\/{{BotId}}\/getSessions?containmentType={{containmentType}}' \\\r\n     --header 'auth: {{YOUR_JWT_ACCESS_TOKEN}}' \\\r\n     --header 'Content-Type: application\/json' \\\r\n     --data-raw '{\r\n        \"skip\" : 0,                          \r\n        \"limit\" : 100,                      \r\n        \"dateFrom\" : \"2020-02-11\",\r\n        \"dateTo\" : \"2020-02-12\"\r\n }'<\/pre>\n<\/li>\n<li>\ud2b9\uc815 \ubd07\uc758 \uacbd\uc6b0\n<pre class=\"\">curl --location --request POST '{{host}}\/api\/public\/bot\/{{BotId}}\/getSessions?containmentType={{containmentType}}' \\\r\n     --header 'auth: {{YOUR_JWT_ACCESS_TOKEN}}' \\\r\n     --header 'Content-Type: application\/json' \\\r\n     --data-raw '{\r\n        \"skip\" : 0,                          \r\n        \"limit\" : 100,                      \r\n        \"dateFrom\" : \"2020-02-11\",\r\n        \"dateTo\" : \"2020-02-12\"\r\n }'<\/pre>\n<\/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>\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>for <em>dropOff<\/em> sessions<\/strong>\n<pre>{\r\n  \"total\": 1,\r\n  \"moreAvailable\": false,\r\n  \"sessions\": [\r\n   {\r\n     \"sessionId\": \"xxxxaxxexxxaxexdxxxdxxxe\",\r\n     \"botId\": \"st-ffeffxxx-xxxc-xexa-axxx-cxxabxxxxcxx\",\r\n     \"channel\": \"rtm\",\r\n     \"userId\": \"u-xxfexxxd-xxex-xdxe-xaec-xeaxbxxxxfxx\",\r\n     \"start_time\": \"2021-04-26T11:27:25.977Z\",\r\n     \"end_time\": \"2021-04-26T11:27:26.145Z\",\r\n     \"session_lang\": [\r\n       \"en\"\r\n      ],\r\n     \"sessionType\": \"interactive\",\r\n     \"containmentType\": \"dropOff\",\r\n     \"isDeveloper\": false,\r\n     \"tags\": {\r\n       \"userTags\": [\r\n        {\r\n         \"value\": \"newuser\",\r\n         \"name\": \"regular\"\r\n        }\r\n      ],\r\n      \"sessionTags\": []\r\n     },\r\n     \"noOfMessagesExchanged\": 1,\r\n     \"noOfTasksExecuted\": 0\r\n   }\r\n  ]\r\n}<\/pre>\n<\/li>\n<li><strong>for <em>Selfservice<\/em> sessions<\/strong>\n<pre>{\r\n  \"total\": 2,\r\n  \"moreAvailable\": false,\r\n  \"sessions\": [\r\n   {\r\n     \"sessionId\": \"xxxxaxxexxxaxexdxxxdxxxe\",\r\n     \"botId\": \"st-ffeffxxx-xxxc-xexa-axxx-cxxabxxxxcxx\",\r\n     \"channel\": \"rtm\",\r\n     \"userId\": \"u-xxfexxxd-xxex-xdxe-xaec-xeaxbxxxxfxx\",\r\n     \"start_time\": \"2021-04-26T11:27:25.977Z\",\r\n     \"end_time\": \"2021-04-26T11:27:26.145Z\",\r\n     \"session_lang\": [\r\n       \"en\"\r\n      ],\r\n     \"sessionType\": \"non-interactive\",\r\n     \"containmentType\": \"selfService\",\r\n     \"isDeveloper\": false,\r\n     \"tags\": {\r\n       \"userTags\": [\r\n        {\r\n         \"value\": \"newuser\",\r\n         \"name\": \"regular\"\r\n        }\r\n       ],\r\n       \"sessionTags\": []\r\n     },\r\n     \"noOfMessagesExchanged\": 6,\r\n     \"noOfTasksExecuted\": 0\r\n    },\r\n   {\r\n     \"sessionId\": \"xxxxaxxexxxaxexdxxxdxxxe\",\r\n     \"botId\": \"st-ffeffxxx-xxxc-xexa-axxx-cxxabxxxxcxx\",\r\n     \"channel\": \"rtm\",\r\n     \"userId\": \"u-xxfexxxd-xxex-xdxe-xaec-xeaxbxxxxfxx\",\r\n     \"start_time\": \"2021-04-26T11:27:25.977Z\",\r\n     \"end_time\": \"2021-04-26T11:27:26.145Z\",\r\n     \"session_lang\": [\r\n       \"en\"\r\n      ],\r\n     \"sessionType\": \"non-interactive\",\r\n     \"containmentType\": \"selfService\",\r\n     \"isDeveloper\": false,\r\n     \"tags\": {\r\n       \"userTags\": [\r\n         {\r\n          \"value\": \"newuser\",\r\n          \"name\": \"regular\"\r\n        }\r\n      ],\r\n     \"sessionTags\": []\r\n     },\r\n     \"noOfMessagesExchanged\": 8,\r\n     \"noOfTasksExecuted\": 0\r\n    }\r\n  ]\r\n}<\/pre>\n<\/li>\n<li><strong>for <em>agent<\/em> sessions<\/strong>\n<pre>{\r\n  \"total\": 1,\r\n  \"moreAvailable\": false,\r\n  \"sessions\": [\r\n   {\r\n     \"sessionId\": \"xxxxaxxexxxaxexdxxxdxxxe\",\r\n     \"botId\": \"st-ffeffxxx-xxxc-xexa-axxx-cxxabxxxxcxx\",\r\n     \"channel\": \"rtm\",\r\n     \"userId\": \"u-xxfexxxd-xxex-xdxe-xaec-xeaxbxxxxfxx\",\r\n     \"start_time\": \"2021-04-26T11:27:25.977Z\",\r\n     \"end_time\": \"2021-04-26T11:27:26.145Z\",\r\n     \"session_lang\": [\r\n       \"en\"\r\n      ],\r\n\t \"sessionType\": \"interactive\",\r\n         \"containmentType\": \"agent\",\r\n\t \"isDeveloper\": false,\r\n\t \"tags\": {\r\n\t\t\"userTags\": [],\r\n\t\t\"sessionTags\": []\r\n\t },\r\n\t \"noOfMessagesExchanged\": 7,\r\n\t \"noOfTasksExecuted\": 2\r\n\t}\r\n  ]\r\n}<\/pre>\n<\/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":"This API retrieves the conversation sessions created. The API details are available in the Bot Builder and Bot Admin Console (BAC) app scopes. To use this API, app needs the Bot Builder API scope of Bot sessions. OR the Admin API Scope of Bot sessions under Bot Analytics. POST\u00a0https:\/\/{{host}}\/api\/public\/bot\/{{BotID}}\/getSessions?containmentType={{containmentType}} and https:\/\/{{host}}\/api\/public\/getSessions?containmentType={{containmentType}} for BAC. Query Parameters...","protected":false},"author":22,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[],"class_list":["post-41278","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\/41278","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\/22"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/comments?post=41278"}],"version-history":[{"count":1,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/41278\/revisions"}],"predecessor-version":[{"id":41279,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/41278\/revisions\/41279"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/media?parent=41278"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/categories?post=41278"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/tags?post=41278"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}