Retrieve single audit log
curl --request GET \
--url https://{tenant}/api/audit-logs/{audit-log-id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{tenant}/api/audit-logs/{audit-log-id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{tenant}/api/audit-logs/{audit-log-id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{tenant}/api/audit-logs/{audit-log-id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{tenant}/api/audit-logs/{audit-log-id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{tenant}/api/audit-logs/{audit-log-id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}/api/audit-logs/{audit-log-id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"_id": "672a83e2b0418b224440ce29",
"req_id": "0462e283-a55f-41ab-6482-60d2eeb1858c",
"org_id": "66cf7f8db0418b1fbe91852b",
"date": "Tue, 05 Nov 2024 17:45:22 -03",
"timestamp": 1730839522,
"ip": "127.0.0.1",
"user": "jhon@mail.com",
"action": "",
"method": "GET",
"url": "/api/audit-logs",
"status": 200
}{
"Message": "could not retrieve audit record",
"Meta": null,
"Status": "Error"
}{
"Message": "Not authorised",
"Meta": null,
"Status": "Error"
}{
"Message": "access denied: You do not have permission to access /api/audit-log",
"Meta": null,
"Status": "Error"
}{
"Message": "could not retrieve audit record",
"Meta": null,
"Status": "Error"
}{
"Message": "Failed to fetch audit record.",
"Meta": null,
"Status": "Error"
}AuditLogs
Retrieve single audit log
Retrieve a single audit log from database by ID
GET
/
api
/
audit-logs
/
{audit-log-id}
Retrieve single audit log
curl --request GET \
--url https://{tenant}/api/audit-logs/{audit-log-id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{tenant}/api/audit-logs/{audit-log-id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{tenant}/api/audit-logs/{audit-log-id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{tenant}/api/audit-logs/{audit-log-id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{tenant}/api/audit-logs/{audit-log-id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{tenant}/api/audit-logs/{audit-log-id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}/api/audit-logs/{audit-log-id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"_id": "672a83e2b0418b224440ce29",
"req_id": "0462e283-a55f-41ab-6482-60d2eeb1858c",
"org_id": "66cf7f8db0418b1fbe91852b",
"date": "Tue, 05 Nov 2024 17:45:22 -03",
"timestamp": 1730839522,
"ip": "127.0.0.1",
"user": "jhon@mail.com",
"action": "",
"method": "GET",
"url": "/api/audit-logs",
"status": 200
}{
"Message": "could not retrieve audit record",
"Meta": null,
"Status": "Error"
}{
"Message": "Not authorised",
"Meta": null,
"Status": "Error"
}{
"Message": "access denied: You do not have permission to access /api/audit-log",
"Meta": null,
"Status": "Error"
}{
"Message": "could not retrieve audit record",
"Meta": null,
"Status": "Error"
}{
"Message": "Failed to fetch audit record.",
"Meta": null,
"Status": "Error"
}Authorizations
The Tyk Dashboard API Access Credentials
Path Parameters
ID of the audit log record to fetch.
Response
Audit Log retrieved successfully
Example:
"672a83e2b0418b224440ce29"
Example:
"0462e283-a55f-41ab-6482-60d2eeb1858c"
Example:
"5e9d9544a1dcd60001d0ed20"
Example:
"Tue, 05 Nov 2024 17:45:22 -03"
Example:
1730839522
Example:
"127.0.0.1"
Example:
"jhon@mail.com"
Example:
"List APIS"
Example:
"GET"
Example:
"/api/apis"
Example:
200
Was this page helpful?
⌘I