{"id":23133,"date":"2020-02-07T11:38:51","date_gmt":"2020-02-07T11:38:51","guid":{"rendered":"https:\/\/developer.kore.ai\/v8-0\/?p=23133"},"modified":"2020-02-08T07:02:37","modified_gmt":"2020-02-08T07:02:37","slug":"get-audit-logs-api","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v8-0\/docs\/bots\/api-guide\/get-audit-logs-api\/","title":{"rendered":"Get Admin Console Audit Logs 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 get admin console audit logs.<\/p>\n<p class=\"note\">To use this API, app needs the Admin API Scope.<\/p>\n<p><b>GET <\/b><code>https:\/\/{{host}}\/<span style=\"font-weight: 400\">api\/public\/auditlogs?size=50&amp;offset=0&amp;fromDate={{timestamp}}&amp;toDate={{timestamp}}&amp;fetchAfter={{AuditLogId}}<\/span><\/code><\/p>\n<p>NOTE: This feature was introduced in ver7.2 of the platform.<\/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<p>&nbsp;<\/p>\n<table>\n<tbody>\n<tr>\n<th>Parameter<\/th>\n<th>Description<\/th>\n<\/tr>\n<tr>\n<td>host<\/td>\n<td>Environment URL, for example, https:\/\/bots.kore.ai<\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">size<\/span><\/td>\n<td>Number of records to be fetched upto a maximum of 100<\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">offset<\/span><\/td>\n<td>Specify the page number from which to start fetching the logs. If unspecified, it starts from 0, which is the first page of the list of logs<\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">fromDate<\/span><\/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<\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">toDate<\/span><\/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<\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">fetchAfter<br \/>\n(optional)<\/span><\/td>\n<td>Audit Log Id from where you want to fetch the logs.<br \/>\nThis is an unique incremental ID for each record created under audit logs and you can obtain it from looking at the previous audit log file.<\/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>http:\/\/localhost\/api\/public\/auditlogs?size=50&amp;offset=0&amp;fromDate=2020-01-02T18:30:00.000Z&amp;toDate=2020-01-07T18:30:00.000Z&amp;fetchAfter=5exxcxxafxxdxxxxaaxdxxxb<\/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    \"total\": 3,\r\n    \"auditlogs\": [\r\n        {\r\n            \"timestampValue\": 1578157612745,\r\n            \"Date\/Time\": \"2020-01-04T17:06:52.745Z\",\r\n            \"Description\": \"xyz logged out at Sat Jan 04 2020 22:36:52 GMT+0530 (India Standard Time) from 127.0.0.1 via web\",\r\n            \"Name\": \"Logout\",\r\n            \"Category\": \"Login \/ Logout\",\r\n            \"AuditLogId\": \"5e10c62ce0e2f05f05f48068\"\r\n        },\r\n        {\r\n            \"timestampValue\": 1578157612773,\r\n            \"Date\/Time\": \"2020-01-04T17:06:52.773Z\",\r\n            \"Description\": \"xyz logged out at Sat Jan 04 2020 22:36:52 GMT+0530 (India Standard Time) from 127.0.0.1 via web\",\r\n            \"Name\": \"Logout\",\r\n            \"Category\": \"Login \/ Logout\",\r\n            \"AuditLogId\": \"5e10c62ce0e2f05f05f48069\"\r\n        },\r\n        {\r\n            \"timestampValue\": 1578292105981,\r\n            \"Date\/Time\": \"2020-01-06T06:28:25.981Z\",\r\n            \"Description\": \"New app admin app 2 is created\",\r\n            \"Name\": \"App Creation - Success\",\r\n            \"Category\": \"App Management\",\r\n            \"AuditLogId\": \"5e12d38a050d9e671163f4b7\"\r\n        }\r\n    ],\r\n    \"moreAvailable\": false\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 admin console audit logs. To use this API, app needs the Admin API Scope. GET https:\/\/{{host}}\/api\/public\/auditlogs?size=50&amp;offset=0&amp;fromDate={{timestamp}}&amp;toDate={{timestamp}}&amp;fetchAfter={{AuditLogId}} NOTE: This feature was introduced in ver7.2 of the platform. Query Parameters &nbsp; Parameter Description host Environment URL, for example, https:\/\/bots.kore.ai size Number of records to be fetched upto a maximum of 100 offset Specify the page...","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-23133","post","type-post","status-publish","format-standard","hentry","category-api-guide"],"_links":{"self":[{"href":"https:\/\/developer.kore.ai\/v8-0\/wp-json\/wp\/v2\/posts\/23133","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.kore.ai\/v8-0\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.kore.ai\/v8-0\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v8-0\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v8-0\/wp-json\/wp\/v2\/comments?post=23133"}],"version-history":[{"count":1,"href":"https:\/\/developer.kore.ai\/v8-0\/wp-json\/wp\/v2\/posts\/23133\/revisions"}],"predecessor-version":[{"id":23134,"href":"https:\/\/developer.kore.ai\/v8-0\/wp-json\/wp\/v2\/posts\/23133\/revisions\/23134"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v8-0\/wp-json\/wp\/v2\/media?parent=23133"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v8-0\/wp-json\/wp\/v2\/categories?post=23133"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v8-0\/wp-json\/wp\/v2\/tags?post=23133"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}