getAllSessionInfo

A MoogDb v2 method that returns session information for all users over a period of time.

Back to MoogDb V2 API Method Reference.

Request arguments

Method getAllSessionInfo takes the following request arguments:

Name

Type

Required

Description

from

Number

No

Start time of the period you want to retrieve session information for. This is in Unix epoch time in seconds. If empty, returns all session information for all users.

to

Number

No

End time of the period you want to retrieve session information for. This is in Unix epoch time in seconds. If empty, returns user records to date.

start

Number

No

Starting record from which data should be included. Default is 0, the first record.

limit

Number

No

Maximum number of records you want to return. Default is 200.

Response

Method getAllSessionInfo returns the following response:

Type

Description

Number

ID of the session.

String

User name for the session.

Number

Start time of the session, in Unix epoch time.

Number

Last access time within the session, in Unix epoch time.

Examples

The following examples demonstrate typical use of method getAllSessionInfo:

Request example

Example request to return session information from Unix epoch time 1570544146 to Unix epoch time 1570704144:

var UserMap2 =  {"start" : 1, "limit":6, "from": 1570544146, "to":1570704144 };
var SessionInfo2 = moogdb.getAllSessionInfo(UserMap2);
logger.warning("getAllSessionInfo..."+ JSON.stringify(SessionInfo2));

Response example

Example response returning session information between Unix epoch times 1570544146 and 1570704144:

getAllSessionInfo...
[{"sessionId":2,"userName":"graze","startTime":1570700522,"lastAccess":1570700522},
{"sessionId":3,"userName":"user4","startTime":1570700529,"lastAccess":1570700529},
{"sessionId":4,"userName":"admin","startTime":1570700675,"lastAccess":1570700675},
{"sessionId":5,"userName":"graze","startTime":1570703911,"lastAccess":1570703911}]