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/2.4.0/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
email 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=oxxxxxxx

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": "10.8.xxx.x",
                "resources": [
                    {
                        "type": "User",
                        "content": "user1"
                    }
                ],
                "eventName": "Log in",
                "account": {
                    "domain": "",
                    "name": "user1",
                    "id": "uxxxxxxxxxxxxxx",
                    "userType": "OU Administrator",
                    "email": "***"
                }
            },
            {
                "eventTime": 1631960162863,
                "ipAddress": "10.8.xxx.x",
                "resources": [
                    {
                        "type": "User",
                        "content": "user2"
                    }
                ],
                "eventName": "Log out",
                "account": {
                    "domain": "",
                    "name": "user2,
                    "id": "uxxxxxxxxxxxxxx",
                    "userType": "Sub-Administrator",
                    "email": "***"
                }
            }
        ]
    },
    "message": "OK"
}