Xbasic

a5w_getActiveUsers Function

IN THIS PAGE

Syntax

c jsondata = a5w_getActiveUsers as c (c timeperiod [, type]])

Arguments

timeperiodCharacter

The time window to retrieve activity. Supports relative periods (e.g. last:10minutes, last:5hours, last:2days) or explicit ranges (e.g. 12/21/2023 05:11 PM::12/25/2023 05:11 PM). For relative values, units are minutes, hours, or days.

typeCharacter

Optional. Either summary or detailed.

Returns

jsondataCharacter

A JSON string with the requested activity data.

Description

Returns activity recorded by the Active Users table for a specified time period.

Discussion

The a5w_getActiveUsers function queries the Active Users table configured in Web Project Properties (Security Framework). The table is appended when users log in and when they make Ajax callbacks, which the function aggregates or enumerates depending on the type argument.

Examples

Get a 5-day summary ranked by most-active users first:

Get detailed events for the last 10 minutes:

dim json as c
json = a5w_getActiveUsers("last:5days","summary")

See Also