Networks

Networks object allows you to retrieve, update and delete network information at the selected location.

API Calls

/V5/networks/{startIndex}/{pageSize}

/V5/networks/latencies

/V5/networks/{networkid}

/V5/networks/{networkid}

/V5/networks/{networkid}

Get Network Information

Description Displays a list of networks detected at the selected location and information about these networks.
Who Can Execute? Superuser, Administrator, Operator, and Viewer.
Syntax
GET <Base_URL>/networks/{startIndex}/{pageSize}?sortcolumn=<value>&
sortascending=<value>&filter=<value>
  • startIndex

    Is used to specify start index of page. It takes an integer value. It is an optional parameter.

  • pageSize

    Is used to specify maximum number of records to fetch. It takes an integer value.
    The maximum page size is 1000. It is an optional parameter.

  • sortcolumn

    Is used to specify a column on which networks will be sorted. It takes a string value. It is an optional parameter.

  • sortascending

    Is used to specify sort order. It takes a boolean value. The default value is true. It is an optional parameter.

  • filter

    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 Network Filter. It is an optional parameter.

Sample code
GET https://192.168.55.179/new/webservice/V5/networks/0/40?sortcolumn=
networkname&sortascending=false&filter=%7B%22property%22%3A%20%
22gatewaymac%22%2C%0A%22value%22%3A%20%5B%2200%3A18%3A19%3A45%3A3D%3AFF
%22%5D%2C%0A%22operator%22%3A%20%22%3D%22%7D%0A%0A
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 network Information. The response is in the application/json format.

Get Network Latencies

Description Fetch’s average network latencies.
Who Can Execute? Superuser, Administrator, Operator, and Viewer.
Syntax
GET <Base_URL>/networks/latencies
Sample code
GET https://training.mojonetworks.com/new/webservice/V5/networks/latencies
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 network latencies. The response is in the application/json format.
The contents of the response body are listed below.

  • averageDhcpLatency

    DHCP latency in milliseconds. It’s an integer value.

  • averageAaaLatency

    AAA latency in milliseconds. It’s an integer value.

  • averageDnsLatency

    DNS Latency in milliseconds. It’s an integer value.

  • averageWanLatency

    WAN Latency in milliseconds. It’s an integer value.

	{
	   "averageDhcpLatency": null,
	   "averageAaaLatency": null,
	   "averageDnsLatency": null,
	   "averageWanLatency": null
	}

Put APIs

Description This API is used to fetch the APs that match the specified filter criteria from the allowed locations for the logged-in user. If no filters are specified, all the APs from the allowed locations are fetched. However, this API is not supported in a server cluster environment.

Note: Do not use this API to fetch more than 100 devices. For fetching larger number of devices, consider using the Get Paged List of APs API.

User Privileges Users with the following roles can call this API: superuser, administrator, and operator.

Request Body Parameters
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 the details of the APs that match the filter criteria. The response is in the application/json format. Click AP to view the complete detais of the JSON along with a sample output.

Error codes
If the API call is successful, the HTTP response status is 200.

Syntax
GET /devices/aps
Sample code
GET https://training.mojonetworks.com/new/webservice/v2/devices/aps
GET
https://training.mojonetworks.com/new/webservice/v2/devices/aps?macaddress=00:11:74:33:23:12&macaddress=00:11:74:45:12:21
GET
https://training.mojonetworks.com/new/webservice/v2/devices/aps?capability=49&locationid=10&locationid=12&sortcolumn=devicename&sortascending=false
URL Parameters This API call takes optional URL parameters to filter the list of APs to be fetched and the column on which the output must be sorted. AP Filter Parameters lists the parmeter names, datatypes, applicable values, and whether the results can be sorted based on the parameter.
Query Parameters This API call takes optional URL parameters to filter the list of APs to be fetched and the column on which the output must be sorted. AP Filter Parameters lists the parmeter names, datatypes, applicable values, and whether the results can be sorted based on the parameter.
Response Body If the API call is successful, the HTTP response status is 200. The response body contains the details of the APs that match the filter criteria. The response is in the application/json format. Click AP to view the complete detais of the JSON along with a sample output.

Put APIs

Description This API is used to fetch the APs that match the specified filter criteria from the allowed locations for the logged-in user. If no filters are specified, all the APs from the allowed locations are fetched. However, this API is not supported in a server cluster environment.

Note: Do not use this API to fetch more than 100 devices. For fetching larger number of devices, consider using the Get Paged List of APs API.

User Privileges Users with the following roles can call this API: superuser, administrator, and operator.

Request Body Parameters
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 the details of the APs that match the filter criteria. The response is in the application/json format. Click AP to view the complete detais of the JSON along with a sample output.

Error codes
If the API call is successful, the HTTP response status is 200.

Syntax
GET /devices/aps
Sample code
GET https://training.mojonetworks.com/new/webservice/v2/devices/aps
GET
https://training.mojonetworks.com/new/webservice/v2/devices/aps?macaddress=00:11:74:33:23:12&macaddress=00:11:74:45:12:21
GET
https://training.mojonetworks.com/new/webservice/v2/devices/aps?capability=49&locationid=10&locationid=12&sortcolumn=devicename&sortascending=false
URL Parameters This API call takes optional URL parameters to filter the list of APs to be fetched and the column on which the output must be sorted. AP Filter Parameters lists the parmeter names, datatypes, applicable values, and whether the results can be sorted based on the parameter.
Query Parameters This API call takes optional URL parameters to filter the list of APs to be fetched and the column on which the output must be sorted. AP Filter Parameters lists the parmeter names, datatypes, applicable values, and whether the results can be sorted based on the parameter.
Response Body If the API call is successful, the HTTP response status is 200. The response body contains the details of the APs that match the filter criteria. The response is in the application/json format. Click AP to view the complete detais of the JSON along with a sample output.

Update Network Information

Description Used to update network information like name, location, and type.
Who Can Execute? Superuser, Administrator, and Operator.
Syntax
POST <Base_URL>/networks/{networkid}
  • networkid

    It is a unique system generated ID assigned to a network. It takes an integer value. It is a mandatory parameter.  To retrieve the value for networkid refer Get Network Information call.

Sample code
POST https://training.mojonetworks.com/new/webservice/V5/networks/3
Request Body This API call requires the information of fields that are to be updated as parameters in
the request body. The parameters are in the application/json format. You must provide the appropriate values for the following attributes:

  • locationid
  • networkName
  • networktype

A sample request body is as follows:

{

	"locationid": 
	{
	   "type": "locallocationid",
	    "id": 1
	 },
	 "networkName": "192.168.120.0/22",
	 "networktype": "CDE"
}
Response Body If the API call is successful, the HTTP response status is 200.
The response body contains updated network details. The response is in the application/json format.

Delete Network Information

Description Delete’s all the information about a network.
Who Can Execute? Superuser, Administrator, and Operator.
Syntax
DELETE <Base_URL>/networks/{networkid}
  • networkid

    It is a unique system generated ID assigned to a network. It takes an integer value. It is a mandatory parameter. To retrieve the value for networkid refer Get Network Information call.

Sample code
DELETE https://training.mojonetworks.com/new/webservice/V5/networks/2
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 204.
The response body does not contain any other information.

Test APIs

Description This API is used to fetch the APs that match the specified filter criteria from the allowed locations for the logged-in user. If no filters are specified, all the APs from the allowed locations are fetched. However, this API is not supported in a server cluster environment.

Note: Do not use this API to fetch more than 100 devices. For fetching larger number of devices, consider using the Get Paged List of APs API.

User Privileges Users with the following roles can call this API: superuser, administrator, and operator.

Request Body Parameters
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 the details of the APs that match the filter criteria. The response is in the application/json format. Click AP to view the complete detais of the JSON along with a sample output.

Error codes
If the API call is successful, the HTTP response status is 200.

Syntax
GET /devices/aps
Sample code
GET https://training.mojonetworks.com/new/webservice/v2/devices/aps
GET
https://training.mojonetworks.com/new/webservice/v2/devices/aps?macaddress=00:11:74:33:23:12&macaddress=00:11:74:45:12:21
GET
https://training.mojonetworks.com/new/webservice/v2/devices/aps?capability=49&locationid=10&locationid=12&sortcolumn=devicename&sortascending=false
URL Parameters This API call takes optional URL parameters to filter the list of APs to be fetched and the column on which the output must be sorted. AP Filter Parameters lists the parmeter names, datatypes, applicable values, and whether the results can be sorted based on the parameter.
Query Parameters This API call takes optional URL parameters to filter the list of APs to be fetched and the column on which the output must be sorted. AP Filter Parameters lists the parmeter names, datatypes, applicable values, and whether the results can be sorted based on the parameter.
Response Body If the API call is successful, the HTTP response status is 200. The response body contains the details of the APs that match the filter criteria. The response is in the application/json format. Click AP to view the complete detais of the JSON along with a sample output.
JSON Table

Attribute Data Type Description
name String Name of the network.
address long IP address of the network.
gateWayMAC String MAC address of the gateway
locationId application/json Location identifier for the Network. The value is of the type Location Id json.
monitoringSensorName String Name of the sensor monitoring the network.
exposedSince int Date and time since which the network is exposed.
networkId int A system generated Id to identify the network.
manuallyTagged boolean A true or false value indicating whether
network properties are manually changed or not.
networkType String Type of the Network. Possible values are

  • CDE (Card Data Environment)
  • Non CDE (Non-Card Data Environment)
sortAcsending boolean A read-only field for internal use.
startIndex int A read-only field for internal use.
searchIndex int A read-only field for internal use.
 previousLink String Link to access the previous group of networks from the list of paged networks.
nextLink String Link to access next group of networks from the list of paged networks.
totalCount String The total number of paged networks.

Sample JSON
{
    "networkList": [
        {
            "name": "192.168.120.0/22",
            "address": "192.168.120.0/22",
            "gateWayMAC": "00:0A:B8:40:E6:4B",
            "locationId": {
                "type": "locallocationid",
                "id": 1
            },
            "monitoringSensorName": null,
            "exposedSince": 1517305304120,
            "networkId": 3,
            "manuallyTagged": false,
            "networkType": "CDE",
            "sortAcsending": false,
            "startIndex": -100,
            "searchIndex": -100
        }
    ],
    "previousLink": "/0/40",
    "nextLink": "/1/40",
    "totalCount": 1
}