- Development Integration
- /
- SDK
- /
- Java
- /
Management module
- /
Get audit log
- /
- Get user behavior log
¶ Get user behavior log
Update time: 2025-07-23 07:34:21
This document is automatically generated based on https://github.com/authing/authing-docs-factory based on https://api-explorer.genauth.ai V3 API, and is consistent with API parameters and return results. If the description of this document is incorrect, please refer to V3 API.
You can select request ID, client IP, user ID, application ID, start timestamp, request success, and paging parameters to obtain user behavior logs
¶ Method Name
ManagementClient.getUserActionLogs
¶ Request Parameters
| Name | Type | Is it required | Default Value | Description | Example Value |
|---|---|---|---|---|---|
| requestId | string | No | - | Request ID | xxx |
| clientIp | string | No | - | Client IP | xxx |
| eventType | string | No | - | Event type, a series of user operations, such as login, logout, register, verifyMfa, etc. | login |
| userId | string | no | - | User id | xxx |
| appId | string | no | - | Application ID | xxx |
| start | number | no | - | Start timestamp | 11 |
| end | number | no | - | End timestamp | 111 |
| success | boolean | no | - | Whether the request is successful | true |
| pagination | ListWebhooksDto | no | - | Pagination |
¶ Sample Code
package test.management;
import cn.authing.sdk.java.client.ManagementClient;
import cn.authing.sdk.java.dto.GetUserActionLogsDto;
import cn.authing.sdk.java.dto.UserActionLogRespDto;
import cn.authing.sdk.java.model.ManagementClientOptions;
import cn.authing.sdk.java.util.JsonUtils;
public class GetUserActionLogsTest {
// Need to be replaced with your GenAuth Access Key ID
private static final String ACCESS_KEY_ID = "AUTHING_ACCESS_KEY_ID";
// Need to be replaced with your GenAuth Access Key Secret
private static final String ACCESS_KEY_SECRET = "AUTHING_ACCESS_KEY_SECRET";
public static void main(String[] args) throws Throwable {
ManagementClientOptions clientOptions = new ManagementClientOptions();
clientOptions.setAccessKeyId(ACCESS_KEY_ID);
clientOptions.setAccessKeySecret(ACCESS_KEY_SECRET);
// If you are a private deployment customer, you need to set the GenAuth service domain name
// clientOptions.setHost("https://api.your-authing-service.com");
ManagementClient client = new ManagementClient(clientOptions);
GetUserActionLogsDto getUserActionLogsDto = new GetUserActionLogsDto();
UserActionLogRespDto userActionLogs = client.getUserActionLogs(getUserActionLogsDto);
System.out.println(JsonUtils.serialize(userActionLogs));
}
}
¶ Request Response
Type: UserActionLogRespDto
| Name | Type | Description |
|---|---|---|
| statusCode | number | Business status code. You can use this status code to determine whether the operation is successful. 200 means success. |
| message | string | Description |
| apiCode | number | Segment error code, through which the specific error type can be obtained (not returned for successful requests). For a detailed list of error codes, see:API Code List (opens new window) |
| requestId | string | Request ID. Returned when the request fails. |
| data | UserActionLogRespData | Response data |
Example Results:
{
"statusCode": 200,
"message": "Operation successful",
"requestId": "934108e5-9fbf-4d24-8da1-c330328abd6c",
"data": {
"totalCount": 1,
"list": {
"userId": "xxx",
"userAvatar": "https://files.authing.co/authing-console/default-app-logo.png",
"userDisplayName": "Zhang San",
"userLoginsCount": 3,
"appId": "xxx",
"appName": "Sample Application",
"clientIp": "127.0.0.1",
"eventType": "login",
"eventDetail": "Log in to the account 「test@example.com」",
"success": true,
"appLoginUrl": "https://example.genauth.ai/login",
"appLogo": "https://files.authing.co/authing-console/default-app-logo.png",
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36",
"parsedUserAgent": {
"device": "Desktop",
"browser": "Chrome",
"os": "Windows"
},
"geoip": {
"location": {
"lon": 116.3889,
"lat": 39.9288
},
"country_name": "China",
"country_code2": "CN",
"country_code3": "CN",
"region_name": "Beijing",
"region_code": "BJ",
"city_name": "Beijing",
"continent_code": "AS",
"timezone": "Asia/Shanghai"
},
"timestamp": "2022-09-20T08:55:00.188+0800",
"requestId": "b63b9772-384c-4f2d-981b-01d1feed964d"
}
}
}
¶ Data Structure
¶ ListWebhooksDto
| Name | Type | Is it required | Description | Example Value |
|---|---|---|---|---|
| page | number | no | Current page number, starting from 1 | 1 |
| limit | number | no | The maximum number of pages per page cannot exceed 50, and the default value is 10 | 10 |
¶ UserActionLogRespData
| Name | Type | Is it required | Description | Example Value |
|---|---|---|---|---|
| totalCount | number | yes | Total number of records | 1 |
| list | array | yes | Return to list Nested Type:UserActionLogDto。 |
¶ UserActionLogDto
| Name | Type | Is it required | Description | Example Value |
|---|---|---|---|---|
| userId | string | yes | User id | xxx |
| userAvatar | string | yes | User avatar | https://files.authing.co/authing-console/default-app-logo.png |
| userDisplayName | string | yes | User display name, displayed in the following user field order: nickname > username > name > givenName > familyName -> email -> phone -> id | Zhang San |
| userLoginsCount | number | yes | Number of user logins | 3 |
| appId | string | yes | Application ID | xxx |
| appName | string | yes | Application Name | Sample Application |
| clientIp | string | no | Client IP, can be filtered based on the client IP at login. By default, the login history of all login IPs is not obtained. | 127.0.0.1 |
| eventType | string | yes | Event Type: - login: Login- logout: Logout- register: Register- verifyMfa: Verify MFA- updateUserProfile: Modify user information- updateUserPassword: Modify password- updateUserEmail: Modify email- updateUserPhone: Modify phone number- bindMfa: Bind MFA- bindEmail: Bind email- bindPhone: Bind phone number- unbindPhone: Unbind phone number- unbindEmail: Unbind email- unbindMFA: Unbind MFA- deleteAccount: Logout account- verifyFirstLogin: First login verification | login |
| eventDetail | string | no | Event details | Login account「 test@example.com 」 |
| success | boolean | yes | Success | true |
| appLoginUrl | string | yes | Application login address | https://example.genauth.ai/login |
| appLogo | string | yes | Application Logo | https://files.authing.co/authing-console/default-app-logo.png |
| userAgent | string | yes | User Agent | Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36 |
| parsedUserAgent | yes | Parsed User Agent nested Type:ParsedUserAgent。 | ||
| geoip | Yes | Geographic location Nested Type: GeoIp. | ||
| timestamp | string | yes | time | 2022-09-20T08:55:00.188+0800 |
| requestId | string | yes | request ID | b63b9772-384c-4f2d-981b-01d1feed964d |
¶ ParsedUserAgent
| Name | Type | Is it required | Description | Example Value |
|---|---|---|---|---|
| device | string | yes | device type used | Desktop |
| browser | string | yes | browserName | Chrome |
| os | string | Yes | Operating system | Windows |
¶ GeoIp
| Name | Type | Is it required | Description | Example Value |
|---|---|---|---|---|
| location | Yes | Geographic location Nested Type: GeoIpLocation. | ||
| country_name | string | Yes | Country Name | China |
| country_code2 | string | Yes | Country Code 2 | CN |
| country_code3 | string | Yes | Country Code 3 | CN |
| region_name | string | Yes | Region Name | Beijing |
| region_code | string | Yes | Region Code | BJ |
| city_name | string | Yes | City Name | Beijing |
| continent_code | string | Yes | Continent Code | AS |
| timezone | string | Yes | Time Zone | Asia/Shanghai |
¶ GeoIpLocation
| Name | Type | Is it required | Description | Example Value |
|---|---|---|---|---|
| lon | number | is | longitude | 116.3889 |
| lat | number | is | latitude | 39.9288 |
