1.4.0 API Breaking Changes

1.4.0 REST API – BREAKING CHANGES

Since version 1.4.0 there have been changes in database structure. These changes affect also Sensmapserver REST API used for management of buildings, plans, anchors, tags, zones and position history. This page summarizes these changes with short description and examples.

FEEDS (Anchors, Tags and Buildings)
  1. type of feed (building, anchor, tag) is now determined by column “type” in feeds, not by metatag, e.g.Prior to version 1.4.0:

    To detect that feed is tag, one would have to search for special string “#rtls_type#tag” in meta-tags, e.g.

    {id:"123", title: "0x00205123456", tags:["#rtls_type#tag"]}
    {id:"124", title: "0xd8205123456", tags:["#rtls_type#anchor"]}
    

    Since version 1.4.0:

    {id:"123", title: "0x00205123456", type:"tag"}
    {id:"124", title: "0xd8205123456", type:"anchor"}
    {id:"125", title:"Building:Example", type:"building"}
    
  2. Added three new columns (building name, plan name, plan id) for special request for content type /application/rtlsserver
    Prior to version 1.4.0GET sensmapserver/api/tags with header content-type:application/rtlsserver

    53;0x0004A3653909;66.1;1.6;0;0;0000;0000;00;
    55;0x0004A36552D0;0.3;108.0;0;0;0000;0000;00;

    Since version 1.4.0

    53;0x0004A3653909;66.1;1.6;0;0;0000;0000;00;Building:JIC;Starcube;1;
    55;0x0004A36552D0;0.3;108.0;0;0;0000;0000;00;Building:JIC;Starcube;1;
  3. Maximum length of title for building changed from 255 to 191 characters
DATASTREAMS
  1. change of datastream in JSON for accelerometers, gyroscopes, magnetometers – specifically name and structure:Prior to version 1.4.0:
    {id:"123", datastreams:[{id:"accX", current_value:"111", at:"..."}, {id:"accY", current_value:"222", at:"..."}, {id:"accZ", current_value:"333", at:"..."}]}

    Since version 1.4.0 merged into one datastream, separated by semicolons (;)

    {id:"123", datastreams:[{id:"acc", current_value:"111;222;333", at:"..."}]}

    Same for gyroscope and magnetometer

POSITIONS
  1. position data is no longer stored in ds_history table and user can no longer use associated routes to retrieve historical positional data:
    /feeds/{feed_id}/datastreams/posX
    /feeds/{feed_id}/datastreams/posY
    /feeds/{feed_id}/datastreams/posZ
    

    Instead user can use sageserver api to easily retrieve positional data: see sageserver API documentation

PLANS
  1. plans for building are now in separate object, not in metatags, e.g.Prior to version 1.4.0:

    GET Request to /sensmapserver/api/buildings

    {"totalResults":1,"results":
    [{"id":"7","alias":"","title":"Building:JIC","creator":"rtlsuser","tags":["plan:#Starcube#:URL:#http:\/\/172.16.18.10\/sensmapserver\/svgs\/uploads\/266c117e6b3fb136ec65b0b54f479a6c297de5fdc9771f4f8a93b2556436b604\/41ab39a8\/JIC_Starcube_0_1.jpg#","#Starcube#_scale:#74.82964004766316","#Starcube#_zeroaxis:(#10.326658624849438_#1475.8219541616402)","outdoorview"],"location":{"disposition":"fixed","ele":"","name":"","lat":"0","exposure":"outdoor","lon":"0","domain":"physical"}}]}

    Since version 1.4.0

    {"totalResults":1,"results":
    [{"id":"7","alias":"","title":"Building:JIC","type":"building","creator":"rtlsuser","model_reference":null,"tags":null,"plans":{"Starcube":{"id":"7001","name":"Starcube","url":"http:\/\/172.16.18.10\/sensmapserver\/svgs\/uploads\/266c117e6b3fb136ec65b0b54f479a6c297de5fdc9771f4f8a93b2556436b604\/41ab39a8\/JIC_Starcube_0_1.jpg","scale":"74.83","originX":"10.32","originY":"1475.82","model_reference":""}},"location":"disposition":"fixed","ele":"","name":"","lat":"0","exposure":"outdoor","lon":"0","domain":"physical"}}]}
    
  2. format of plans retrieved by
    GET /api/buildings/{building_id}/plans
    Prior to version 1.4.0

    {"totalResults":1,
    "results":[{"plan_name":"Starcube","url":"http:\/\/172.16.18.10\/sensmapserver\/svgs\/uploads\/266c117e6b3fb136ec65b0b54f479a6c297de5fdc9771f4f8a93b2556436b604\/41ab39a8\/JIC_Starcube_0_1.jpg","scale":"74.83","originX":"10.32","originY":"1475.82"}]}
    

    Since version 1.4.0

    {"Starcube":{"id":"1","name":"Starcube","originX":"10.32","originY":"1475.82","scale":"74.83","url":"http:\/\/172.16.18.10\/sensmapserver\/svgs\/uploads\/266c117e6b3fb136ec65b0b54f479a6c297de5fdc9771f4f8a93b2556436b604\/41ab39a8\/JIC_Starcube_0_1.jpg","building_reference":"40011","model_reference":"0"}}
    
  3. changing scale/origin/name for plan now automatically modifies zones (and paths), there is no need for separate PUT request to all zones for given plan
  4. Maximum length of plan name changed to 191 characters
ZONES
  1. route for listing zones (GET) and creating (POST)
    Prior to version 1.4.0:
    GET /buildings/{id}/zones/{plan_name}
    POST /buildings/{id}/zones

    Since version 1.4.0
    GET /buildings/{id}/plans/{plan_name}/zones
    POST /buildings/{id}/plans/{plan_name}/zones
  2. removed route for global updating of scale and origin for all zones:
    PUT /buildings/{id}/zones/{plan_name}
    Since version 1.4.0
    This is applied automatically for all zones of given plan when scale or origin is changed
  3. removed table zones_history and corresponding API route
    Prior to version 1.4.0:GET /sensmapserver/api/zones/{zone_id}/history

    Since version 1.4.0 user can use sageserver API to retrieve time in zone history

  4. renamed field “feed_id” to “building_reference” and field “plan” to “plan_name” for zones.
    Prior to version 1.4.0

    [{"polygon":"POLYGON((0.8 -3.3,0.8 -1.4,3.0 -1.4,3.0 -3.3,3.0 -3.7,0.8 -3.7,0.8 -3.3))","id":"25","name":"Zona Load#1","type":"info","plan":"Starcube","feed_id":"7"}]

    Since version 1.4.0

    [{"polygon":"POLYGON((0.8 -3.3,0.8 -1.4,3.0 -1.4,3.0 -3.3,3.0 -3.7,0.8 -3.7,0.8 -3.3))","id":"25","name":"Zona Load#1","type":"info","plan_name":"Starcube","building_reference":"7"}]
CATEGORIES
  1. Maximum length of category name changed to 191 characters