{"id":23133,"date":"2020-02-07T11:38:51","date_gmt":"2020-02-07T11:38:51","guid":{"rendered":"https:\/\/developer.kore.ai\/v9-0\/?p=23133"},"modified":"2021-07-13T13:16:15","modified_gmt":"2021-07-13T12:16:15","slug":"get-audit-logs-api","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v9-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>curl --location --request GET '  \r\n  https:\/\/{{host}}\/api\/public\/auditlogs?size=50&amp;offset=0&amp;fromDate=2021-07-07T11:11:18.464Z&amp;toDate=2021-06-30T11:11:18.469Z' \\\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=\"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<p><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-0\/wp-content\/uploads\/sites\/21\/20210713131454\/img.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-28587\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-0\/wp-content\/uploads\/sites\/21\/20210713131454\/img.png\" alt=\"\" width=\"812\" height=\"784\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-0\/wp-content\/uploads\/sites\/21\/20210713131454\/img.png 812w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v9-0\/wp-content\/uploads\/sites\/21\/20210713131454\/img-300x290.png 300w\" sizes=\"auto, (max-width: 812px) 100vw, 812px\" \/><\/a><\/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><\/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\/v9-0\/wp-json\/wp\/v2\/posts\/23133","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.kore.ai\/v9-0\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.kore.ai\/v9-0\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v9-0\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v9-0\/wp-json\/wp\/v2\/comments?post=23133"}],"version-history":[{"count":2,"href":"https:\/\/developer.kore.ai\/v9-0\/wp-json\/wp\/v2\/posts\/23133\/revisions"}],"predecessor-version":[{"id":28590,"href":"https:\/\/developer.kore.ai\/v9-0\/wp-json\/wp\/v2\/posts\/23133\/revisions\/28590"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v9-0\/wp-json\/wp\/v2\/media?parent=23133"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v9-0\/wp-json\/wp\/v2\/categories?post=23133"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v9-0\/wp-json\/wp\/v2\/tags?post=23133"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}