QueryUserAppUsageAggregateByHour

Updated at:

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

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

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.