Query Audit Logs¶
Query the records of audit logs.
Request Format¶
POST https://{apigw-address}/app-portal-service/v2.2/log/query
Request Parameters (URI)¶
Name |
Location (Path/Query) |
Required/Optional |
Data Type |
Description |
---|---|---|---|---|
orgId |
Query |
Required |
String |
OU ID. How to get orgId >> |
locale |
Query |
Optional |
String |
Specifies the language in which to return the list information. The following values are supported:
|
Request Parameters (Body)¶
Name |
Required/Optional |
Data Type |
Description |
---|---|---|---|
startTime |
Required |
String |
Start timestamp. |
endTime |
Required |
String |
End timestamp. |
pagination |
Required |
Pagination Struct |
Lists the paging requirements in a request. Pagination Request Struct >> |
Response Parameters¶
Name |
Data Type |
Description |
---|---|---|
pagination |
pagination Struct |
Pagination information. pagination Struct >> |
auditLog |
AuditLogEntry Struct |
Audit logs. AuditLogEntry Struct >> |
Pagination Struct¶
Name |
Data Type |
Description |
---|---|---|
pageNo |
Integer |
The request pages. |
pageSize |
Integer |
The number of records in each page. |
totalElements |
Long |
The total number of records. |
AuditLogEntry Struct¶
Name |
Data Type |
Description |
---|---|---|
eventTime |
String |
The created time of the event. |
account |
Account Struct |
Account information. Account Struct >> |
resources |
Resource Struct |
Resource information. Resource Struct >> |
eventName |
String |
Event name. |
ipAddress |
String |
IP address. |
Account Struct¶
Name |
Data Type |
Description |
---|---|---|
id |
String |
User ID. |
name |
String |
User name. |
String |
The user’s email address. |
|
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"
}