Online Sessions API
POST /getOnlineSessions
Description
This API endpoint retrieves the list of active (online) sessions for a specific user, including detailed session information.
Request Body
The request uses GraphQL to perform the getOnlineSessions
query.
Query:
query getOnlineSessions ($userId: Int!) {
getOnlineSessions (userId: $userId) {
id
sessionId
nasIpAddress
nasPortId
nasPortType
startTime
connectInfoStart
callingStationId
framedIpAddress
}
}
GraphQL Variables:
{
"userId": 0
}
Example Request:
curl --location '' \
--header 'Content-Type: application/json' \
--data '{"query":"query getOnlineSessions ($userId: Int!) {\n getOnlineSessions (userId: $userId) {\n id\n sessionId\n nasIpAddress\n nasPortId\n nasPortType\n startTime\n connectInfoStart\n callingStationId\n framedIpAddress\n }\n}","variables":{"userId":0}}'
Response:
-
Success (200 OK):
- The response includes a list of active (online) sessions for the specified user.
{
"data": {
"getOnlineSessions": [
{
"id": 1,
"sessionId": "sess456",
"nasIpAddress": "192.168.1.2",
"nasPortId": "port2",
"nasPortType": "wifi",
"startTime": "2024-08-11T14:00:00Z",
"connectInfoStart": "connection start info",
"callingStationId": "station456",
"framedIpAddress": "192.168.1.101"
}
]
}
}- Fields:
id
: Unique identifier for the session record.sessionId
: Identifier for the session.nasIpAddress
: IP address of the Network Access Server (NAS).nasPortId
: Identifier for the NAS port.nasPortType
: Type of the NAS port.startTime
: Timestamp when the session started.connectInfoStart
: Information at the start of the session.callingStationId
: Identifier for the calling station.framedIpAddress
: IP address assigned to the session.
-
Error (4XX/5XX):
- If there is an issue with the request or if there is a server error, the response will include an error message and status code.
Parameters:
- userId (Int): The unique identifier of the user for whom the online sessions are being retrieved.
Note:
This endpoint provides detailed information about active sessions for a specific user, which can be useful for monitoring and managing user activity. Ensure that you provide a valid userId
to retrieve the relevant online session records.