Query Audit Logs¶
Query the records of audit logs.
Request Format¶
POST https://{apigw-address}/app-portal-service/v2.2/log/query
Request Parameters (Query)¶
Name |
Mandatory/Optional |
Data Type |
Description |
---|---|---|---|
orgId |
Mandatory |
String |
OU ID |
locale |
Optional |
String |
language. |
Request Parameters (Body)¶
Name |
Mandatory/Optional |
Data Type |
Description |
---|---|---|---|
startTime |
Mandatory |
String |
Start timestamp |
endTime |
Mandatory |
String |
End timestamp |
pagination |
Optional |
Pagination Struct |
Pagination parameter, see ` Pagination Request Struct >> </docs/api/en/dev/overview.html#pagination-pagination>`__. If not specified, the default pagination size is 1000 pages. |
Response Parameters¶
Name |
Data Type |
Description |
---|---|---|
data |
Data Struct |
Audit log information |
Data Struct¶
Name |
Data Type |
Description |
---|---|---|
pagination |
pagination Struct |
Pagination information |
auditLog |
AuditLogEntry Struct |
Audit logs |
AuditLogEntry Struct¶
Name |
Data Type |
Description |
---|---|---|
eventTime |
String |
Event time |
account |
Account Struct |
account information |
resources |
Resource Struct |
Resource information |
eventName |
String |
Event name |
description |
String |
Event description |
ipAddress |
String |
IP address |
Account Struct¶
Name |
Data Type |
Description |
---|---|---|
id |
String |
User ID |
name |
String |
User name |
String |
User email |
|
domain |
String |
User domain |
userType |
String |
User type |
Resource Struct¶
Name |
Data Type |
Description |
---|---|---|
type |
String |
Resource type |
content |
String |
Resource content |
Error Codes¶
Error Code |
Description |
---|---|
31400 |
The OU ID, pagination, start timestamp, and end timestamp are required |
Samples¶
Request Sample¶
url: https://{apigw-address}/app-portal-service/v2.2/log/query?orgId=your_org_id
method: POST
requestBody:
{
"pagination": {
"pageNo": 0,
"pageSize": 2
},
"startTime": 1626796800000,
"endTime": 1631980799000
}
Return Sample¶
{
"code": 0,
"data": {
"pagination": {
"total": 2835,
"limit": 2,
"currentPage": 0
},
"auditLog": [
{
"eventTime": 1631960934544,
"ipAddress": "your_ip_address_1",
"resources": [
{
"type": "User",
"content": "user1"
}
],
"eventName": "Log in",
"account": {
"domain": "",
"name": "your_user_name_1",
"id": "your_user_id_1",
"userType": "OU Administrator",
"email": "your_user_email_1"
}
},
{
"eventTime": 1631960162863,
"ipAddress": "your_ip_address_2",
"resources": [
{
"type": "User",
"content": "user2"
}
],
"eventName": "Log out",
"account": {
"domain": "",
"name": "your_user_name_2,"
"id": "your_user_id_2",
"userType": "Sub-Administrator",
"email": "your_user_email_2"
}
}
]
},
"message": "OK"
}