Documentation

timeman.networkrange.check

The method is used to check if an IP address is included in the office network IP range.

Parameters

ParameterExampleRequiredDescription
IP 10.10.255.255 No IP address.

If the IP parameter is not specified, the the next IP address is checked.

Call example

JavaScript

BX24.callMethod('timeman.networkrange.check', {
	'IP': '10.10.255.255'
}, function(result){
	if(result.error())
	{
		console.error(result.error().ex);
	}
	else
	{
		console.log(result.data());
	}
});

PHP

$result = restCommand('timeman.networkrange.check', Array(
	'IP' => '10.10.255.255'
), $_REQUEST["auth"]);	

Response example

{    
	"result": {
		ip: "10.10.255.255", 
		range: "10.0.0.0-10.255.255.255", 
		name: "Office network 10.x.x.x"
	}
}

Description of keys

  • ip - IP address that was checked.
  • range - range that includes the specified IP address.
  • name - name of the range that includes the specified IP address.

Response example in case of an error

{
    "error": "ACCESS_ERROR",
    "error_description": "You don't have access to user this method"
}
  • Key error - error code.
  • Key error_description - brief error description.

Possible error codes

CodeDescription
ACCESS_ERRORSpecified method is available only to administrators.


© «Bitrix24», 2001-2024