Share

Import Buildings

Import Buildings

API: Update Buildings

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>

Parameters

<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"),
    );

Returns

JSON encoded array containing

 array(
    "Unchanged" => <count>,
    "Changed"   => <count>,
    "Added"     => <count>,
    "Deleted"   => <count>
    );

Comments

The HTTP request can either be sent using a HTTP GET or POST.

Sample Powershell Code

Download Code