get_traffic_statistics_for_a_client

Client’s Traffic Statistics

This API call helps us to gain traffic statistics for a client in a particular time frame. For this it needs the SSID list, type of performance trend that is required and the frequency band to distinguish which one is taken from 2,4, or, 5.

JSON Table

Attribute Data Type Description
time long Time in epoch format.
fromvalue long Number of bytes transfered.
tovalue long Number of bytes received.
totalvalue long Total number of bytes transfered and recieved.
totalCount long No of data points.

Copy Sample JSON
Sample JSON
{
   "samples":[{
      "time": 1491542100,
      "fromvalue": 1817,
      "tovalue": 18469,
      "totalvalue": 20286
   },
   {
      "time": 1491543000,
      "fromvalue": 3295,
      "tovalue": 66769,
      "totalvalue": 70064
   },

    . . .
    . . .
    . . .	

   {
       "time": 1491555600,
       "fromvalue": 4350,
       "tovalue": 82047,
       "totalvalue": 86397
    }],
    "totalCount": 927971
}
API Calls

/V5/devices/clients/statistics/traffic

Get Traffic Statistics for a Client

Description This API is used to fetch traffic statistics for a client.
Users with the following roles can call this API: super user, administrator, operator, and viewer.
Syntax
GET <Base_URL>/devices/clients/statistics/traffic?boxid=<value>&fromtime=<value>&
totime=<value>&type=ssid=<value>&frequencyband=<value>

Here,

  • boxid

    It is used to specify the client box ID. It takes an Integer value. The default value is -1. It is a mandatory field. To fetch the appropriate boxid you can use Clients call.

  • fromtime

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

  • totime

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

  • type

    It is used to specify the type of performance trend that is required. It takes String value. Possible value is clienttraffic. It is a mandatory field.

  • ssid

    It is used to specify the list of SSIDs for which the results should be returned. It takes String value. To fetch the list of SSIDs refer Get SSIDs Configured on a Managed Device.

  • frequencyband

    It is used to specify frequency band filter. It takes String value. Possible values are 2.4, 5 and ANY(default).

Sample code
GET https://training.mojonetworks.com/new/webservice/v5/devices/clients/statistics
/traffic/?boxid=9565&fromtime=1491541711692&locationid=19&nodeid=0&
totime=1491556111692&type=clienttraffic
GET https://training.mojonetworks.com/new/webservice/v5/devices/clients/statistics
/traffic?type=clienttraffic&boxid=80112405&ssid=test-min-b
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 Client’s Traffic Statistics is in the application/json format.