QueryAuthUserConnectDurationList

Updated at:

Queries the connection duration statistics of authorized users based on specified conditions. Statistics can be collected by daily cumulative duration or by individual session details.

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

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request syntax

POST  HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

DataDate

string

No

The date for the statistics, in the yyyy-MM-dd format. If this parameter is left empty, statistics from the previous day are returned by default.

2026-06-24

ComparisonOperator

string

No

The comparison operator for connection duration. This parameter is used together with Threshold to filter users by a threshold. Valid values:

  • GreaterThanThreshold: greater than the threshold.

  • LessThanThreshold: less than the threshold.

GreaterThanThreshold

Threshold

integer

No

The connection duration threshold, in seconds. This parameter must be used together with ComparisonOperator.

3600

UserName

string

No

The name of the end user. Fuzzy match is supported. When you use this parameter, you must also specify IsAdUser.

alice

IsAdUser

boolean

No

Specifies whether to query only Active Directory (AD) users. This parameter is required when UserName or WithDetail is specified.

WithDetail

boolean

No

Specifies whether to backfill user details such as display name and nickname. This parameter supports both AD users and convenience users. When you use this parameter, you must also specify IsAdUser.

PageNum

integer

No

The page number, starting from 1. Default value: 1. This parameter takes effect only when statistics are collected by daily cumulative duration (StatisticType=Daily).

1

PageSize

integer

No

The number of entries per page. Default value: 100. Maximum value: 100.

100

StatisticType

string

No

The statistics type. Valid values:

  • Daily: collects statistics by daily cumulative connection duration. This is the default value.

  • SingleSession: collects statistics by individual session details.

Daily

NextToken

string

No

The paging token. This parameter is used only when statistics are collected by individual session details (StatisticType=SingleSession). You do not need to specify this parameter for the first request. For subsequent requests, set this parameter to the NextToken value returned in the previous response to retrieve the next page.

d129c6c0e8c04c8a9f0e2b7c1a3f5e6d

Response elements

Element

Type

Description

Example

object

Schema of Response

AuthUserConnectDurationList

array<object>

The connection duration list of authorized users.

object

ConnectDuration

integer

The connection duration of the user, in seconds.

3600

ConnectEndTime

string

The end time of the connection, as a UNIX timestamp in milliseconds. This parameter is returned only when statistics are collected by individual session details (StatisticType=SingleSession).

1719208800000

ConnectStartTime

string

The start time of the connection, as a UNIX timestamp in milliseconds. This parameter is returned only when statistics are collected by individual session details (StatisticType=SingleSession).

1719205200000

Description

string

The remarks of the user. This parameter is returned only for convenience users when WithDetail is set to true.

R&D department employee

DesktopId

string

The cloud desktop ID.

ecd-gx2x1dhsmusr2****

DesktopName

string

The cloud desktop name.

test-desktop

DirectoryType

integer

The type of the directory to which the user belongs. Valid values:

  • 1: convenience account.

  • 2: RAM account.

  • 3: AD account.

  • 4: personal edition.

3

DisplayName

string

The display name of the user. This parameter is returned only for AD users when WithDetail is set to true.

Zhang San

DisplayNameNew

string

The new display name of the user. This parameter is returned only for AD users when WithDetail is set to true.

Zhang San

DomainName

string

The AD domain name.

example.com

EndUserId

string

The end user ID.

alice

NickName

string

The nickname of the user. This parameter is returned only for convenience users when WithDetail is set to true.

Xiao Zhang

RegionId

string

The region ID.

cn-hangzhou

UserPrincipalName

string

The user principal name (UPN). This parameter is returned only for AD users when WithDetail is set to true.

alice@example.com

NextToken

string

The pagination token for the next page. This parameter is returned when the results span multiple pages. Pass this value as the NextToken in the next request to retrieve the next page. This parameter is returned only when statistics are collected by individual session details.

d129c6c0e8c04c8a9f0e2b7c1a3f5e6d

RequestId

string

The request ID.

1CBAFFAB-B697-4049-A9B1-67E1FC5F0F0F

TotalCount

integer

The total number of records that match the specified conditions.

100

Examples

Success response

JSON format

{
  "AuthUserConnectDurationList": [
    {
      "ConnectDuration": 3600,
      "ConnectEndTime": "1719208800000",
      "ConnectStartTime": "1719205200000",
      "Description": "研发部员工",
      "DesktopId": "ecd-gx2x1dhsmusr2****",
      "DesktopName": "test-desktop",
      "DirectoryType": 3,
      "DisplayName": "Zhang San",
      "DisplayNameNew": "Zhang San",
      "DomainName": "example.com",
      "EndUserId": "alice",
      "NickName": "小张",
      "RegionId": "cn-hangzhou",
      "UserPrincipalName": "alice@example.com"
    }
  ],
  "NextToken": "d129c6c0e8c04c8a9f0e2b7c1a3f5e6d",
  "RequestId": "1CBAFFAB-B697-4049-A9B1-67E1FC5F0F0F",
  "TotalCount": 100
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.