Buildings can be added, modified and removed from ServiceView using the following API:
http://<serviceview_url>/update_buildings.php?data=<data>&remove_others=<remove_others>&secret=<secret>
<data> | JSON encoded array of buulding names and references |
<remove_others> | Set to 1 to remove all buildings that aren't included in this post |
<secret> | The value of the SECRET option set in the options setup section. |
data is a JSON encoded multi-dimentional array containing building names and references. A reference is a unique identifier for a building.
$data = array( array("name"=>"Building 1 Name", "reference"=>"UniqueCodeForBuilding1"), array("name"=>"Building 2 Name", "reference"=>"UniqueCodeForBuilding2"), );
JSON encoded array containing
array( "Unchanged" => <count>, "Changed" => <count>, "Added" => <count>, "Deleted" => <count> );
The HTTP request can either be sent using a HTTP GET or POST.