Floorplans

URI Definition

Method

URI and Fields

GET

/iap/floorplans

Returns all floor plans that the current user is permitted to get. Returned floor plans can be reduced to only id's and coordinates.

Parameters (optional)

  • coordsOnly – true/false (false by default) if set to true, then returned FloorPlanDTO will contain only floor plan ID and it's coordinates
  • scId - if specified accumulates all devices owned by segment controller with the specified id and returns floor plans found devices are belong to. If segment controller is assigned on any floor itself, it is also taken into account
  • scName - if specified accumulates all devices owned by segment controller with the specified name and returns floor plans found devices are belong to. If segment controller is assigned on any floor itself, it is also taken into account
  • pg – page number
  • sz – page size

Success Response

Collection of floor plans.

Example

https://localhost/iap/floorplans


Response:

[
    {
        "id": 1382,
        "name": "First floor plan",
        "description": null,
        "geozoneId": 88,
        "latitude": 37.3847,
        "longitude": -121.98507
    }
]                                                                                                                                           

/iap/floorplans/{id}/floors

Returns all floors related to the specified floor plan that the current user has the permission to get.

Parameters 

  • id - ID of the floor plan.

For optional parameters, see ...  

Success Response

Collection of floors for a specified floor plan.

Example

https://localhost/iap/floorplans/1382/floors


Response:

[
    {
        "id": 1383,
        "name": "First Floor",
        "description": null,
        "floorNumber": "1",
        "floorplanId": 1382,
        "image": "iVBORw0KGgoAAAANSUhEUgAABoUAAAMzCAIAAADvdozd...",
        "devicesCount": 0
    }
]                                                                                                                                               

/iap/floorplans/count

Returns the number of floor plans available for the current user to get. 

Success Response

Number of floor plans.

Example

https://localhost/iap/floorplans/count


Response:

{                                                                                                                                               
    "value": 5
}

/iap/floorplans/listByIDs

Returns collection with coordinates for specified ids.

Parameters 

  • ids -  collection of IDs of floor plans

Request Payload

[integer, integer, …]

Success Response

Collection of floor plans.

Example

https://localhost/iap/floorplans/listByIDs


Request Body:

[1382]


Response:

[
    {
        "id": 1382,
        "name": "First floor plan",
        "description": null,
        "geozoneId": 88,
        "latitude": 37.3847,
        "longitude": -121.98507
    }
]                                                                                                                                             

PUT

/iap/floorplans/{id}

Updates an already existing floor with the specified properties.

Parameters 

  • id – ID of the updated floor plan

Success Response

Returns successfully updated floor.

Example

https://localhost/iap/floorplans/1384


Request Body:

{
  "geozoneId":88,
  "name":"Second floor plan UPDATED",
  "latitude":38.3847,
  "longitude":-120.98507
}

Response:

{
    "id": 1384,
    "name": "Second floor plan UPDATED",
    "description": null,
    "geozoneId": 88,
    "latitude": 38.3847,
    "longitude": -120.98507
}                                                                                                                                            

/iap/floorplans/floors/{id}

Updates existing floor plan with specified properties.

Parameters

  • id - the ID of the floor plan to update

Success Response

Successfully updated floor.

Example

https://localhost/iap/floorplans/floors/1383                                                               

Request Payload

{
  "id":1383,
  "name":"First Floor UPDATED",
  "description":"Test floor",
  "floorNumber":"1",
  "floorplanId":1382,
  "devicesCount":0
}

Response

{
    "id": 1383,
    "name": "First Floor UPDATED",
    "description": "Test floor",
    "floorNumber": "1",
    "floorplanId": 1382,
    "image": "iVBORw0KGgoAAAANSUhE...",
    "devicesCount": 0
}

POST

/iap/floorplans

Creates new floor plan from the specified properties.

Success Response

Returns successfully created floor plan.

Example

https://localhost/iap/floorplans


Request Body:

{
  "geozoneId":88,
  "name":"Second floor plan",
  "latitude":38.3847,
  "longitude":-120.98507
}

Response:

{
    "id": 1384,
    "name": "Second floor plan",
    "description": null,
    "geozoneId": 88,
    "latitude": 38.3847,
    "longitude": -120.98507
}                                                                                                                                            

/iap/floorplans/{id}/floors

Creates a floor on the specified floor plan with the uploaded image.

Parameters

  • id - ID of the updated floor plan

Success Response

Properties of successfully created floor.

Example

https://localhost/iap/floorplans/1382/floors


Request Payload:

------WebKitFormBoundarytoHjPCweBo7mR1ig
Content-Disposition: form-data; name="data"; filename="blob"
Content-Type: application/json

{"name":"First Floor","floorNumber":"1"}
------WebKitFormBoundarytoHjPCweBo7mR1ig
Content-Disposition: form-data; name="file"; filename="floor.png"
Content-Type: image/png

------WebKitFormBoundarytoHjPCweBo7mR1ig--


Response:

{
    description: null
    devicesCount: 0
    floorNumber: "1"
    floorplanId: 1382
    id: 1383
    image: "iVBORw0KGgoAAAANSUhEUgAABoUAAAMzCAIAAADvdozdAAAAAX"
    name: "First Floor"
}                                                                                                                                            

DELETE

/iap/floorplans/{id}

Deletes specified floor plan from the CMS.

Parameters

  • id - the ID of the floor plan to delete

Success Response

State of performed operation. True in case of success and false otherwise.

Example

https://localhost/iap/floorplans/1384


Response:

{
    "value": true
}                                                                                                                                           

/iap/floorplans/floors/{id}

Deletes the specified floor from the CMS.

Parameters

  • id - the ID of the floor to delete

Success Response

State of operation. True in case of success and false otherwise.

Example

https://localhost/iap/floorplans/floors/1383


Response:

{
    "value": true
}                                                                                                                                           

Query Parameters

Optional query parameters can be used with your REST request.  Specifying queries is described under Queries and ParametersPath Parameters, and Query Parameters.