QueryUserAppUsageTimeRank

Updated at:

Queries the ranking of cumulative application usage duration for a specified user within a date range.

Operation description

Queries the ranking of application usage duration for a specified user within a statistical range. 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. The results are sorted in descending order of cumulative application usage duration.

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:QueryUserAppUsageTimeRank

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 ID of the app instance group, 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 of the statistical period, 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 of the statistical period, in yyyyMMdd format. If this parameter is not provided, it defaults to yesterday. The date cannot be earlier than StartDate and 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.

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 the ListRegions operation to obtain the ID.

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 ranking list of user application usage duration, sorted in descending order of cumulative usage duration.

object

The data list object.

AppId

string

The ID of the application.

app-9ciijz60n4xsv****

AppName

string

The name of the application.

Visual Studio Code

AppTimeCnt

string

The cumulative usage duration of the application within the statistical range. Unit: seconds.

200

AppVersion

string

The version of the application. The current version may not return this value, and callers should not rely on this field. A non-empty value indicates the application version.

1.96.0

Message

string

The description of the request processing result. If the request is successful, success is usually returned.

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",
      "AppVersion": "1.96.0"
    }
  ],
  "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.