FLOOR PLANS

Use the Floor Plans API to:

  • Get all floor plans from the server.
  • Get a single floor plan from the server.
  • Create a floor plan.
  • Edit a floor plan.
  • Delete a floor plan.

Note: The following terminology has changed.

Current term Former term Definition
Area Sublocation A section of a site that has its own floorplan, for example, each floor of a multi-story building can be defined as an area.
Site Location A space that has RTLS coverage, for example, a building or a campus. A server might service one or more sites.

HTTP Headers

The HTTP headers are used to access all RTLS APIs are listed below. Before submitting requests to the floor plans API, set the following headers.

Header Name Example Value Description
X-User-Email admin@example.com Email of the user performing HTTP requests to the API.
X-User-Token Drv3yU7PdyqUMtr89erZ Token allowing user access to the API.
X-User-Project OfOgUA4kTs2HrmYYlFw6Jg Project identifier. Value of the project.uid field.
Set header X-USER-EMAIL

Send a request to log in using POST api/auth/log_in.json described in the Auth API. Using the email address returned in the response, set: X-USER-EMAIL = data.email

Set header X-USER-TOKEN

Send a request to log in using POST api/auth/log_in.json described in the Auth API. Using the authentication token returned in the response, set: X-USER-TOKEN = data.token

Set header X-USER-PROJECT

Send a request to get projects using GET api/projects/ described in the Projects API. You must send this request with headers X-USER-EMAIL and X-USER-TOKEN already set. Using the project UID returned in the response, set: X-USER-PROJECT = projects[i].uid

Floorplans Endpoints

Functionality Method Endpoint
get floorplans GET api/floorplans
get single floorplan GET api/floorplans/{uid}
create floorplan POST api/floorplans
edit floorplan PUT api/floorplans/{uid}
delete floorplan DELETE api/floorplans/{uid}

Endpoints

Get floorplans

GET api/floorplans

Get all floor plans.

Response Fields

Field Description
project_uid The unique identifier of the project where floor plan was created.
company_uid The unique identifier of the company for which the floor plan was created.
sublocation_id The identifier of the area in the context of the project.
image_scale The scale of the image, in the number of decimeters per pixel.
image_rotation The image rotation measured in degrees.
image_offset_x The image offset from the sublocation position, in pixels.
image_offset_y The image offset from the sublocation position, in pixels.
created_at The time stamp of when the floor plan was created, in UTC.
updated_at The time stamp of when the floor plan was last updated, in UTC.
uid The unique identifier of the floor plan.
sublocation_uid The unique identifier of the area in which the floor plan was created.
img_blob The image stored in database.
selected Whether the floor plan is the default floor plan for its area (0 or 1).
display_name The display name of the image.
width The width of the image, in pixels.
height The height of the image, in pixels.
size The image size in bytes.
url The URL to access the image.

Example Response

{
    "floorplans": [
        {
            "project_uid": "xwacfMumRVejZlhnZhNrKw",
            "company_uid": "O1tByya0SNyHySedZpWIAg",
            "sublocation_id": 99,
            "image_scale": 80,
            "image_rotation": 90,
            "image_offset_x": 10,
            "image_offset_y": 20,
            "created_at": "2017-06-14T10:13:41.000Z",
            "updated_at": "2017-06-14T10:14:46.000Z",
            "uid": "M8zoKr-IRTCVglJaXnICRA",
            "sublocation_uid": "Nnm9J7fKRCOLYr4ePE4_lg",
            "img_blob": null,
            "selected": 0,
            "display_name": "imageName.gif",
            "width": 100,
            "height": 100,
            "size": 2615,
            "url": "/uploads/floorplan/image/M8zoKr-IRTCVglJaXnICRA/imageName.gif"
        },
        {
            "project_uid": "xwacfMumRVejZlhnZhNrKw",
            "company_uid": "O1tByya0SNyHySedZpWIAg",
            "sublocation_id": 95,
            "image_scale": 1,
            "image_rotation": 0,
            "image_offset_x": 0,
            "image_offset_y": 0,
            "created_at": "2017-06-14T10:16:22.000Z",
            "updated_at": "2017-06-14T10:16:22.000Z",
            "uid": "mFTDNEGRRW63jZ3pqRhcAQ",
            "sublocation_uid": "MJl9Dup3SC2WrpdQRMLoHw",
            "img_blob": null,
            "selected": 0,
            "display_name": "trolltunga.jpg",
            "width": 1000,
            "height": 300,
            "size": 45941,
            "url": "/uploads/floorplan/image/mFTDNEGRRW63jZ3pqRhcAQ/trolltunga.jpg"
        }
    ]
}

Get single floorplan

GET api/floorplans/{uid} Get a floor plan with a specified floor plan UID. To retrieve a floor plan UID, see get floorplans.

Example Response

{
    "floorplans": [
        {
            "project_uid": "xwacfMumRVejZlhnZhNrKw",
            "company_uid": "O1tByya0SNyHySedZpWIAg",
            "sublocation_id": 99,
            "image_scale": 80,
            "image_rotation": 90,
            "image_offset_x": 10,
            "image_offset_y": 20,
            "created_at": "2017-06-14T10:13:41.000Z",
            "updated_at": "2017-06-14T10:14:46.000Z",
            "uid": "M8zoKr-IRTCVglJaXnICRA",
            "sublocation_uid": "Nnm9J7fKRCOLYr4ePE4_lg",
            "img_blob": null,
            "selected": 0,
            "display_name": "imageName.gif",
            "width": 100,
            "height": 100,
            "size": 2615,
            "url": "/uploads/floorplan/image/M8zoKr-IRTCVglJaXnICRA/imageName.gif"
        }
    ]
}

Example Response

The following response is returned when the UID for the floor plan does not exist.

{
    "floorplans": []
}

Create floorplan

POST api/floorplans Create a new floor plan.

Request Fields

Field Required/Optional Type Description
image - object A JSON object with information about the image file.
image.file required binary,encoding('base64') Image decoding in Base64 format.
image.original_filename optional string.min(3).max(255) The file name for the image.
sublocation_uid required string(22) The unique identifier of the area. To retrieve an area UID, see Sublocations API.
display_name optional string The display name for the image.
image_scale optional number, positive The scale of the image, in the number of decimeters per pixel.
image_rotation optional number The image rotation measured in degress.
image_offset_x optional number The image offset from the area position, in pixels.
image_offset_y optional number The image offset from the area position, in pixels.

Response Fields

Field Description
sublocation_id The identifier of the sublocation in the context of the server.
image_scale The scale of the image, in the number of decimeters per pixel.
image_rotation The image rotation measured in degrees.
image_offset_x The image offset from the sublocation position, in pixels.
image_offset_y The image offset from the sublocation position, in pixels.
created_at The time stamp of when the floor plan was created, in UTC.
updated_at The time stamp of when the floor plan was last updated, in UTC.
uid The unique identifier for the floor plan.
sublocation_uid The unique identifier of the area where the floor plan was created.
img_blob The image stored in database.
selected Whether the floor plan is the default floor plan for its area. Returns 0 or 1.
display_name The display name of the floor plan image.
width The size of the image width, in pixels.
height The size of image height, in pixels.
size The image size in bytes.
url The URL to access the image.

Example Request

{
    "image": {
        "file": "R0lGODlhZABkANUAANnUTGZfUP/gsFtWM8a1mv/4df/02v/u1f/oxQAAAKCdOLyrkP7+/vjarM7Crv/95DUyJ5GDb7StSpaQhvzvcSsoHOfZwrm5uXxyYtbW1qeSc+jiUvPobODbT+np6cO8Tf/ruf/frkdCMaaekv/v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ZanMELZLCAAZxU7lW4MxHE5ILYiMDvLkg81gH/hKAwXiCLf7zkJ0/5ymsdEUEAADs=",
        "original_filename": "imageName.gif"
    },
    "sublocation_uid": "Nnm9J7fKRCOLYr4ePE4_lg",
    "display_name": "imageName.gif",
    "image_scale": 200,
    "image_rotation": 90,
    "image_offset_x": 20,
    "image_offset_y": 10
}

Example Response

{
  "sublocation_id": 99,
  "image_scale": 200,
  "image_rotation": 90,
  "image_offset_x": 20,
  "image_offset_y": 10,
  "created_at": "2017-06-14T10:13:41.000Z",
  "updated_at": "2017-06-14T10:13:41.000Z",
  "uid": "M8zoKr-IRTCVglJaXnICRA",
  "sublocation_uid": "Nnm9J7fKRCOLYr4ePE4_lg",
  "img_blob": null,
  "selected": 0,
  "display_name": "imageName.gif",
  "width": 100,
  "height": 100,
  "size": 2615,
  "url": "/uploads/floorplan/image/M8zoKr-IRTCVglJaXnICRA/imageName.gif"
}

Errors

Error Status Error Type Error Body Description
404 Not Found {"message":"Sublocation '...' not found"} A sublocation with the specified UID was not found in the project.
422 Unprocessable entity {"message":"Floorplan with image name '....' already exist in sublocation '...' of project '...'"} A duplicate floor plan in that sublocation already exists.

Edit floorplan

PUT api/floorplans/{uid} Edit a floor plan with a specified floor plan UID. To retrieve a floor plan UID, see get floorplans.

Request fields

The following fields can be edited using GET api/floorplans.

Field Required/Optional Type Description
image_scale optional number, positive The scale of the image, in the number of decimeters per pixel.
image_rotation optional number The image rotation clockwise measured in degrees.
image_offset_x optional number The image offset from the sublocation position, in pixels.
image_offset_y optional number The image offset from the sublocation position, in pixels.
sublocation_uid optional string The unique identifier of the area. To retrieve an area UID, see Sublocations API.

Response Fields

Field Description
sublocation_id The identifier of the area in the context of the server.
image_scale The scale of the image, in the number of decimeters per pixel.
image_rotation The image rotation clockwise measured in degrees.
image_offset_x The image offset from the sublocation position, in pixels.
image_offset_y The image offset from the sublocation position, in pixels.
created_at The time stamp of when the floor plan was created, in UTC.
updated_at The time stamp of when floor plan was last updated, in UTC.
uid The unique identifier for the floor plan.
sublocation_uid The unique identifier of the area in which the floorplan was created.
img_blob Reserved field.
selected Reserved field.
display_name Reserved field. Returns null.
width The image width, in pixels.
height The image height, in pixels.
size The image size in bytes.
url The URL to access the image.

Example Request

{
    "image_scale": 80,  
    "image_rotation": 90,
    "image_offset_x": 10,
    "image_offset_y": 20
}

Example Response

{
    "sublocation_id": 99,
    "image_scale": 80,
    "image_rotation": 90,
    "image_offset_x": 10,
    "image_offset_y": 20,
    "created_at": "2017-06-14T10:13:41.000Z",
    "updated_at": "2017-06-14T10:14:46.000Z",
    "uid": "M8zoKr-IRTCVglJaXnICRA",
    "sublocation_uid": "Nnm9J7fKRCOLYr4ePE4_lg",
    "img_blob": null,
    "selected": 0,
    "display_name": "imageName.gif",
    "width": 100,
    "height": 100,
    "size": 2615,
    "url": "/uploads/floorplan/image/M8zoKr-IRTCVglJaXnICRA/imageName.gif"
}

Errors

Error Status Error Type Error Body Description
404 Not Found {"message":"Floorplan '...' not found"} A floor plan with the specified UID was not found in the project.
422 Unprocessable entity {"message":"Floorplan with image name '....' already exist in sublocation '...' of project '...'"} A duplicate floorplan was found.

Delete floorplan

DELETE api/floorplans/{uid} Delete a floor plan using a specified floor plan UID. To retrieve a floor plan UID, see get floorplans.

Successful request returns status 204.

results matching ""

    No results matching ""