get_clients_by_group

Get Clients by Group

Clients are grouped into different categories based on 3 categories: opprotocol, capability, and failuretype. This call returns the number of groups with their group name and the number of clients under each group. This displays the type of group that has been created from either of the 3 options.

JSON Table

Attribute Data Type Description
group application/json
group/<groupby field> String Group by field provided in query param.
count int Total number of devices matching the groupby crtiteria.
totalCount int Number of data points.

Copy Sample JSON
Sample JSON
{
   "samples": [{
      "group": {
         "opprotocol": "A"
      },
      "count": 497
   },
   {
      "group": {
	     "opprotocol": "BG"
	  },
	  "count": 837
   }],
   "totalCount": 1334
}
API Calls

/V5/devices/clients/statistics/groupby

Get Clients by Group

Description This API is used to fetch client by group by fields.
Users with the following roles can call this API: super user, administrator, operator, and viewer.
Syntax
GET <Base_URL>/devices/clients/statistics/groupby

Here,

  • groupby

    It is used to specify the field on which groupby Is to be applied. It takes a string value. Possible values are opprotocol, capability, and failuretype.

  • fromtime

    It is used to specify UTC start time in milliseconds. It takes an Integer value. The default value is -1.

  • totime

    It is used to specify UTC end time in milliseconds. It takes an Integer value. The default value is -1.

  • clientmacaddress

    It is used to specify client macaddress. It takes String value. This is used only in the case of groupby=failuretype. To fetch the appropriate clientmacaddress you can use Clients call.

  • filter

    It is used to filter the results. Click Filter to view details of how filters need to be specified in the URL. For possible names of property attribute, datatypes, applicable values, and whether the results can be sorted based on the parameter click Client Filter.

Sample code
GET https://training.mojonetworks.com/new/webservice/V5/devices/clients/statistics
/groupby?groupby=opprotocol
Request Body  This API call does not require any request body parameters.
Response Body  If the API call is successful, the HTTP response status is 200.
The response body contains a list of clients grouped by the specified field in the application/json format.