phpIPAM API documentation v 0.1
===============================

phpIPAM provides API server for providing data to clients. It is a webapp and can be called 
via HTTP requests by providing appropriate GET parameters that define controller, actions and
additional parameters required for each controller, such as id, name, etc.

Response is in JSON format with success true or false and provided error message or object.

You can find examples of client API calls in folder api/_examples/.

Client based request values must be encrypted with app_id and app_code. You first have to
enable API module in phpipam administration and create an app_id and app_code, that will be 
used for external app with appropriate permissions.


Required php extensions for API server:
	mcrypt
	curl


Available controllers:
--------------------------------
	sections
	subnets
	addresses
	vlans
	vrfs
	//users
	//groups

Available actions:
------------------
	read
	create
	update
	delete
	
	
Output format for subnets and IP addresses
------------------------------------------
	You can manually specify output format for subnets and IP addresses:
	
	format=decimal		returns in decimal form (default)
	format=ip			returns in IP address
	




Per-controller options and examples
===================================

= Sections
----------
	= read
		all				returns all sections
		id				returns section by id
		name			returns section by name
		
		example: ?controller=sections&action=read&id=1

	= create
		not available
		
	= update
		not available	
		
	= delete
		id				(mandatory) id of the section to be deleted
		subnets			will delete also belonging subnets (default = true)
		addresses		will delete also belonging ips (default = true)

		example: ?controller=sections&action=delete&id=1
		

= Subnets
---------
	= read
		all				returns all subnet
		id				returns subnet by id
		sectionId		returns all subnets in specified sectionId
		format			returns subnet in specified format
		
		example: ?controller=subnets&action=read&id=1
		
	= create
		not available

	= update
		not available

	= delete
		id				(mandatory)	 subnet id
		addresses		will delete also belonging ips (default = true)

		example: ?controller=addresses&action=delete&id=1
		

= IP addresses
--------------		
	= read
		subnetId		returns all ip addresses in subnet
		id				returns ip address details by id
		format			returns ip in specified format
		
		example: ?controller=addresses&action=read&id=1
		
	= create
		not available

	= update
		not available

	= delete
		id				(mandatory)	

		example: ?controller=addresses&action=delete&id=1
		
		
= Vlans
-------		
	= read
		all				returns all vlans
		id				returns vlan details by id
		subnets			return also ids of all attached subnets
		
		example: ?controller=vlans&action=read&id=1
		
	= create
		not available

	= update
		not available

	= delete
		id				(mandatory)	

		example: ?controller=vlans&action=delete&id=1

= VRFs
-------		
	= read
		all				returns all vrfs
		id				returns vrf details by id
		subnets			return also ids of all attached subnets
		
		example: ?controller=vrfs&action=read&id=1
		
	= create
		not available

	= update
		not available

	= delete
		id				(mandatory)	

		example: ?controller=vrfs&action=delete&id=1