Skip to main content

Online Users API

POST /getOnlineUsers

Description

This API endpoint retrieves the total number of online users with optional pagination and filtering based on various criteria.

Request Body

The request uses GraphQL to perform the getOnlineUsers query.

Query:

query getOnlineUsers ($page: Int, $size: Int, $serverId: Int, $groupId: Int, $roleId: Int, $serviceGroupId: Int) {
getOnlineUsers (page: $page, size: $size, serverId: $serverId, groupId: $groupId, roleId: $roleId, serviceGroupId: $serviceGroupId) {
totalElements
size
number
}
}

GraphQL Variables:

{
"page": 0,
"size": 0,
"serverId": 0,
"groupId": 0,
"roleId": 0,
"serviceGroupId": 0
}

Example Request:

curl --location '' \
--header 'Content-Type: application/json' \
--data '{"query":"query getOnlineUsers ($page: Int, $size: Int, $serverId: Int, $groupId: Int, $roleId: Int, $serviceGroupId: Int) {\n getOnlineUsers (page: $page, size: $size, serverId: $serverId, groupId: $groupId, roleId: $roleId, serviceGroupId: $serviceGroupId) {\n totalElements\n size\n number\n }\n}","variables":{"page":0,"size":0,"serverId":0,"groupId":0,"roleId":0,"serviceGroupId":0}}'

Response:

  • Success (200 OK):

    • The response includes details about the number of online users and pagination information.
    {
    "data": {
    "getOnlineUsers": {
    "totalElements": 120,
    "size": 10,
    "number": 1
    }
    }
    }
    • Fields:
      • totalElements: The total number of online users matching the criteria.
      • size: The number of users per page.
      • number: The current page number.
  • 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:

  • page (Int): The page number for pagination.
  • size (Int): The number of users per page for pagination.
  • serverId (Int): Optional filter for users associated with a specific server.
  • groupId (Int): Optional filter for users belonging to a specific group.
  • roleId (Int): Optional filter for users with a specific role.
  • serviceGroupId (Int): Optional filter for users associated with a specific service group.

Note:

This endpoint allows you to query and paginate through online users, with additional filters for server, group, role, and service group. Adjust the parameters according to your needs to get the relevant online users' data.