QueryUserAppUsageAggregateByHour
Queries the cumulative duration of application usage by a specified user on an hourly basis and returns the top five applications for each hour.
Operation description
Queries the application usage of a specified user on an hourly basis. StartDate and EndDate use the yyyyMMdd format. If either parameter is not provided, it defaults to yesterday. Both dates must be within the last 90 days, and the start date cannot be later than the end date. The query range includes the start and end dates. UserId must be set to the ID of the user to be queried. A maximum of the top five applications by usage duration are returned for each hour.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
appstreaming:QueryUserAppUsageAggregateByHour |
get |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
No |
The region ID for OpenAPI access, which is used for request authentication and routing. To filter business data by region, use BizRegionId. |
cn-hangzhou |
| AppInstanceGroupId |
string |
No |
The app instance group ID, which is used to filter data for a specified app instance group. If this parameter is not provided, data is not filtered by app instance group. |
aig-9ciijz60n4xsv**** |
| StartDate |
string |
No |
The start date for statistics, in yyyyMMdd format. If this parameter is not provided, it defaults to yesterday. The date cannot be earlier than 90 days before the call date. The query range includes this date. The date is interpreted as a calendar date in the Asia/Shanghai (UTC+8) time zone. |
20260901 |
| EndDate |
string |
No |
The end date for statistics, in yyyyMMdd format. If this parameter is not provided, it defaults to yesterday. The date cannot be earlier than StartDate or 90 days before the call date. The query range includes this date. The date is interpreted as a calendar date in the Asia/Shanghai (UTC+8) time zone. |
20260907 |
| UserId |
string |
No |
The ID of the end user to be queried. This parameter must be explicitly provided. If it is not provided, no matching records are usually returned. |
user01 |
| BizRegionId |
string |
No |
The business region ID, which is used to filter application usage data. If this parameter is not provided, data is not filtered by business region. You can call ListRegions to obtain the value. |
cn-hangzhou |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The API response. |
||
| Code |
string |
The business status code. A value of 200 indicates that the request was processed successfully. Other values indicate that the processing failed. |
200 |
| IndexData |
array<object> |
The list of user application usage data aggregated by hour. A maximum of five records are returned for each hour. |
|
|
object |
The data list object. |
||
| AppId |
string |
The application ID. |
app-9ciijz60n4xsv**** |
| AppName |
string |
The application name. |
Visual Studio Code |
| AppTimeCnt |
string |
The cumulative usage duration of the application within the statistical range. Unit: seconds. |
200 |
| Hh |
string |
The statistical hour, represented as a two-digit 24-hour format string with values ranging from 00 to 23. Hour boundaries are divided based on the Asia/Shanghai (UTC+8) time zone. |
02 |
| Message |
string |
The description of the request processing result. The value success is usually returned when the request is successful. |
success |
| RequestId |
string |
The unique identifier of the request, which can be used to troubleshoot request issues. |
1CBAFFAB-B697-4049-A9B1-67E1FC5F**** |
Examples
Success response
JSON format
{
"Code": "200",
"IndexData": [
{
"AppId": "app-9ciijz60n4xsv****",
"AppName": "Visual Studio Code",
"AppTimeCnt": "200",
"Hh": "02"
}
],
"Message": "success",
"RequestId": "1CBAFFAB-B697-4049-A9B1-67E1FC5F****"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.