Bluetooth Beacon Tracker exposes a RESTful web API that can be used to access and manipulate the state of set of resources registered with a site. An introduction to the API and an explanation about all the available resources can be found in this page. The list of resources and the supported methods is summarized in the following tables along with examples of usages with cURL.
Synchronous Access
Type: GET
Function: retrieves the list of sites registered with an user account
Request:
- Path parameters: no information is passed along with the request.
- Headers: empty
- Body: empty
- Authorization: none
Response:
- Status: 200 OK
- Headers:
- Content-type: application/json
- Body: JSON array of site descriptors.
Example:
Query the list of sites registered with the account “username”:
curl -u username:password https://its.accuware.com/api/v1/sites/
The result is an array [{…}, {…}, …] of JSON objects:
[
{
"desc": "EXP. JUN 8th - DEVELOPMENT",
"siteId": "1001",
"address": "1.899079,4.80904",
"name": "Site A",
"access": "30",
},
{
"desc": "OPEN ENDED - PRODUCTION",
"siteId": "1002",
"address": "43.857165,-79.460979",
"name": "Site B",
"access": "30",
}
]
JSON fields:
- desc: expiration day of your site along with the type of account.
- siteId: site identification.
- address: used to point to the map on the area of interest in to the Bluetooth Beacon Tracker dashboard.
- company: company name provided inside the Accuware Site Creation form.
- name: site name.
- access: access levels for each account registered.
GET
Retrieves information about a specific site
Resource-wide template parameters:
- {siteId}: site identification string.
Available response representations:
- 200 OK – application/json.
- JSON representation of the site.
[stextbox id=”grey”]
Example:
Retrieve information about the site with siteId=”1001″:
curl -u username:password https://its.accuware.com/api/v1/sites/1001/
The result is a JSON object:
{ "desc": "EXP. JUN 8th - DEVELOPMENT", "siteId": "1001", "address": "1.899079,4.80904", "name": "Site A", "access": "30", }
JSON fields:
- desc: expiration day of your site along with the type of account.
- siteId: site identification.
- address: used to point to the map on the area of interest in to the Bluetooth Beacon Tracker dashboard.
- company: company name provided inside the Accuware Site Creation form.
- name: site name.
- access: access levels for each account registered
GET
Retrieves the information of all the BLE nodes registered within a specific site.
Resource-wide template parameters:
- {siteId}: site identification string
Available response representations:
- 200 OK – application/json.
- JSON array of BLE nodes descriptors.
Example:
Retrieve the list of BLE nodes registered with siteId=”1001″:
curl -u username:password https://its.accuware.com/api/v1/sites/1001/nodes/
The result is an array [{…}, {…}, …] of JSON objects:
[ { "mac": "7072CF21EB13", "siteId": "1001", "name": "node5", "desc": "", "loc": { "lat": 32.797667, "lng": -117.249145, "levelId": 0, "source": "manual" }, "lrrt": 4, "lrne": 8 }, { "mac": "7072CF1733B0", "siteId": "1001", "name": "node3", "desc": "", "loc": { "lat": 32.797543, "lng": -117.249094, "levelId": 0, "source": "manual" }, "lrrt": 3, "lrne": 10 } ]
JSON fields:
- mac: MAC address of the BLE node.
- name: BLE node’s name.
- desc: BLE node description (e.g. penthouse).
- levelId: level identification.
- lrrt (Last Report Relative Time): difference in seconds between the last report transmitted by the BLE node and the time the request was issued.
- lrne (Last Report Number of Entries): number of unique stations transmitted by the BLE node in its last report.
/api/v1/sites/{siteId}/nodes/{mac}/
GET
Retrieves the information of a specific BLE node registered within a specific site.
Resource-wide template parameters:
- {siteId}: site identification string
- {mac}: the BLE node’s MAC address
Available response representations:
- 200 OK – application/json.
- JSON representation of the BLE node.
Example:
Retrieve information about the BLE node with MAC address 7072CF2148F0 from siteId=”1001″:
curl -u username:password https://its.accuware.com/api/v1/sites/1001/nodes/7072CF2148F0/
The result is a JSON object:
{ "mac": "7072CF21EB13", "siteId": "1001", "name": "node5", "desc": "", "loc": { "lat": 32.797667, "lng": -117.249145, "levelId": 0, "source": "manual" }, "lrrt": 4, "lrne": 8 }
JSON fields:
- name: BLE node’s name.
- desc: BLE node description (e.g. penthouse node).
- levelId: level identification.
- lrrt (Last Report Relative Time): difference in seconds between the last report transmitted by the BLE node and the time the request was issued.
- lrne (Last Report Number of Entries): number of unique stations detected and transmitted by the BLE node in its last report.
PUT
Register a BLE node within a selected site
Resource-wide template parameters:
- {siteId}: site identification string
- {mac}: the BLE node’s MAC address
Accepted representations:
- application/x-www-form-urlencoded
BLE node information:
- Required fields are lat and lng.
- Optional fields are name, desc, and levelId.
If the BLE node is new, it will be created. If the BLE node was already registered, its information will be overwritten.
Example:
Register a BLE node with MAC address 000011112222 in siteId=”1001″:
curl -u username:password -X PUT -d "name=Office14b&desc=corner office&lat=32.911982&lng=-117.114369&levelId=0" https://its.accuware.com/api/v1/sites/1001/nodes/000011112222/
The result is a JSON object that describes the BLE node just registered:
{ "mac":"000011112222", "name":"Office14b", "desc":"corner office", "siteId":"1001", "loc":{ "source":"manual", "lng":"32.911982", "lat":"-117.114369", "levelId":"0", } }
DELETE
Remove a BLE node from the selected site
Resource-wide template parameters:
- {siteId}: site identification string
- {mac}: the BLE node’s MAC address
Accepted representations:
- none.
- No information is passed along with the request
Example:
Remove the BLE node with MAC address 000011112222 from siteId 1001:
curl -u username:password -X DELETE https://its.accuware.com/api/v1/sites/1001/nodes/000011112222/
The result is a confirmation message:
{ "status": "success" }
Querying for a BLE node just removed will return an HTTP 404 – Not found status code:
{ "status": "error", "errors": [ "Resource not found" ] }
/api/v1/sites/{siteId}/stations/?loc=[yes|no]&type=[known|all]&lrrt=maxValue&rss=[yes|no]&ble=yes&areas=[yes|no]
GET
Retrieves the list of stations active (or previously active) within the selected site. Since the number of active stations might be large, it is possible to control the amount of returned data by setting the query parameters.
Resource-wide template parameters:
- {siteId}: site identification string.
Query parameters:
- loc [ yes | no ]: a flag that determines if the server will return location data in the response (default: loc=no).
- type [ known | all ]: the type of stations to query (default: type=known).
- lrrt (Last Report Relative Time): the maximum value for the lrrt field of the stations returned. The lrrt measures the seconds elapsed between the time the station was last seen active and the time the server was queried. (default: lrrt=600 which is equal to 10 minutes).
- rss [ yes | no ]: a flag that determines if the server will return RSS data for each BLE node in the response (default: rss=no). Click here to get more information about the RSS.
- ble [ yes | no ]: a flag that determines if the server will return additional data related to the BLE beacons in the response (default: ble=no).
- areas [ yes | no ]: a flag that determines if the server will return the list of geo-fences in which the device is located (default: areas=no). This parameter requires the loc parameter to be equal to yes.
- The “Known stations” are always included in the returned response regardless the value of the lrrt parameter.
- Keep in mind that it will not be possible to see the location and the RSS for the “Known stations” just added into the “known devices” list but never seen by the BLE nodes (even if loc=yes and rss=yes).
Available response representations:
- 200 OK – application/json
- JSON array of station descriptors
Example 1:
Retrieve the list of stations active within siteId=1001. If the query parameters are not specified, the default values will be used:
curl -u username:password https://its.accuware.com/api/v1/sites/1001/stations/
The result is a JSON object:
[ { "mac": "IAHXUH9AAZJ4", "name": "B14", "desc": "", "lrrt": 4 }, { "mac": "IAOBBXAO7980", "name": "B19", "desc": "", "lrrt": 4 }, { "mac": "I2JW3CCCFIK6", "name": "B34", "desc": "", "lrrt": 5 } ]
JSON fields:
- mac: BLE beacons within a site are identified by their pseudo MAC address (pMAC) which is a unique ID generated by the Bluetooth Beacon Tracker dashboard starting from the UUID, Major and Minor.
- name: station’s name.
- desc: station description.
- lrrt (Last Report Relative Time): measures the seconds elapsed between the time the device was last seen active and the time the server was queried. For example, a value lrtt=4 means that the station was active four seconds before its location was queried.
Example 2:
Retrieve all the stations active in the last 15 seconds, and request location information and RSS in the response:
curl -u username:password "https://its.accuware.com/api/v1/sites/1001/stations/?loc=yes&type=all&lrrt=15&rss=yes&ble=yes&areas=yes"
The result is an array [{…}, {…}, …] of JSON objects:
[ { "mac": "IAHXUH9AAZJ4", "name": "B14", "desc": "", "loc": { "lat": 41.617076, "lng": 0.648719, "levelId": 0, "prec": 3 }, "lrrt": 4, "areas": [ "7" ], "rss": { "F45EAB1AA89D": -90, "F45EAB1AAA73": -84, "F45EAB0AA158": -85, "F45EAB0AA34C": -86, "F45EAB0AAFBA": -88, "F45EAB1427E9": -89, "F45EAB097277": -79 }, "ble": { "uui": "4609032A65DA404C9D8F5D1A646285B4", "major": 14, "minor": 14, "power": -58, "battery": 255, "mv": 2 } }, { "mac": "IAOBBXAO7980", "name": "B19", "desc": "", "loc": { "lat": 41.617076, "lng": 0.648719, "levelId": 0, "prec": 3 }, "lrrt": 4, "areas": [ "7", "8" ], "rss": { "F45EABB4289D": -90, "F45EAB142A73": -87, "F45EAB0CBB58": -87, "F45EABBC134C": -82, "F45EAB09BB77": -80 }, "ble": { "uui": "4609032A65DA404C9D8F5D1A646285B4", "major": 19, "minor": 19, "power": -58, "battery": 255, "mv": 1 } }, { "mac": "I2JW3CCCFIK6", "name": "B34", "desc": "", "loc": { "lat": 41.617076, "lng": 0.648719, "levelId": 0, "prec": 3 }, "lrrt": 5, "areas": [ "9" ], "rss": { "F45EACC4289D": -89, "F45EAB142ACC": -87, "F45EAB09CC77": -81 }, "ble": { "uui": "4609032A65DA404C9D8F5D1A646285B4", "major": 34, "minor": 34, "power": -58, "battery": 255, "mv": 0 } } ]
JSON fields:
- mac: BLE beacons within a site are identified by their pseudo MAC address (pMAC) which is a unique ID generated by the Bluetooth Beacon Tracker dashboard starting from the UUID, Major and Minor.
- name: station’s name.
- desc: station description.
- loc: station location.
- lat: latitude.
- lng: longitude.
- levelID: ID of the level.
- prec: (not relevant).
- lrrt (Last Report Relative Time): measures the seconds elapsed between the time the device was last seen active and the time the server was queried. For example, a value lrtt=4 means that the station was active four seconds before its location was queried.
- areas: the list of geo-fences in which the device is located.
- rss: signal strength measured by all the BLE nodes able to see the station. Click here to get more information about the RSS.
- ble: additional data related to the BLE beacons
- uuid: the UUID of the BLE beacon
- major: the major of the BLE beacon
- minor: the minor of the BLE beacon
- power: the Measured Power advertised by the BLE beacon. This the dBm that is transmitted by the BLE beacon when it is at 1 meter of distance. This value is a constant that can be set using the App of the BLE beacon vendor.
- battery: the battery level of the BLE beacon (at present it should not be taken into account because the value returned is always 255 or 0).
- mv: the movement status of the BLE beacon:
- 0 if it is not moving.
- 1 if it is moving.
- 2 if it does not have the movement sensor.
/api/v1/sites/{siteId}/stations/{mac}/?rss=[yes|no]&ble=[yes|no]&areas=[yes|no]
GET
Retrieves information about a specific station.
Resource-wide template parameters:
- {siteId}: site identification string.
- {mac}: the station’s pMAC address. The pseudo MAC address (pMAC) is a unique ID generated by the Bluetooth Beacon Tracker dashboard starting from the UUID, Major and Minor.
Query parameters:
- rss [yes|no]: a flag that determines if the server will return RSS data for each BLE node in the response (default: rss=no).
- ble [yes|no]: a flag that determines if the server will return additional data related to the BLE beacons in the response (default: ble=no).
- areas [ yes | no ]: a flag that determines if the server will return the list of geo-fences in which the device is located (default: areas=no).
Available response representations:
- 200 OK – application/json
- JSON representation of the station
Example:
Retrieve location and RSS information about the station with MAC address IAHXUH9AAZJ4 from siteId=”1001″:
curl -u username:password "https://its.accuware.com/api/v1/sites/1001/stations/IAHXUH9AAZJ4/?rss=yes&ble=yes&areas=yes"
The result is a JSON Object. If the location of the station is available, it will be returned with the response. Additionally, if the station has been previously registered in the list of known stations, its name and description will be returned in the representation as well:
[ { "mac": "IAHXUH9AAZJ4", "name": "B14", "desc": "", "loc": { "lat": 41.617076, "lng": 0.648719, "levelId": 0, "prec": 3 }, "lrrt": 4, "rss": { "F45EAB1AA89D": -90, "F45EAB1AAA73": -84, "F45EAB0AA158": -85, "F45EAB0AA34C": -86, "F45EAB0AAFBA": -88, "F45EAB1427E9": -89, "F45EAB097277": -79 }, "ble": { "uui": "4609032A65DA404C9D8F5D1A646285B4", "major": 14, "minor": 14, "power": -58, "battery": 255, "mv": 0 }, "areas": [ "14" ] } ]
JSON fields:
- mac: BLE beacons within a site are identified by their pseudo MAC address (pMAC) which is a unique ID generated by the Bluetooth Beacon Tracker dashboard starting from the UUID, Major and Minor.
- name: station’s name.
- desc: station description.
- loc: station location.
- lat: latitude.
- lng: longitude.
- levelID: ID of the level.
- prec: (not relevant).
- lrrt (Last Report Relative Time): measures the seconds elapsed between the time the device was last seen active and the time the server was queried. For example, a value lrtt=4 means that the station was active four seconds before its location was queried.
- rss: signal strength measured by all the BLE nodes able to see the station. Click here to get more information about the RSS.
- ble: additional data related to the BLE beacons
- uuid: the UUID of the BLE beacon
- major: the major of the BLE beacon
- minor: the minor of the BLE beacon
- power: the Measured Power advertised by the BLE beacon. This the dBm that is transmitted by the BLE beacon when it is at 1 meter of distance. This value is a constant that can be set using the App of the BLE beacon vendor.
- battery: the battery level of the BLE beacon (at present it should not be taken into account because the value returned is always 255 or 0).
- mv: the movement status of the BLE beacon:
- 0 if it is not moving.
- 1 if it is moving.
- 2 if it does not have the movement sensor.
- areas: the list of geo-fences in which the device is located.
PUT
Registers a station in the list of known devices.
Resource-wide template parameters:
- {siteId}: site identification string.
- {mac}: the station’s pMAC address. The pseudo MAC address (pMAC) is a unique ID generated by the Bluetooth Beacon Tracker dashboard starting from the UUID, Major and Minor.
Accepted representations:
- application/x-www-form-urlencoded
Station information:
- The fields name and desc can contain empty values
[stextbox id=”grey”]
Example:
Register a station with MAC address I072CF173037 in siteId=”1001″:
curl -u username:password -X PUT -d "name=iBeacon 1&desc=Radius Network" https://its.accuware.com/api/v1/sites/1001/stations/I072CF173037/
The result is a JSON that describes the station just registered:
{ "mac":"I072CF173037", "name":"iBeacon 1", "desc":"Radius Network", }
DELETE
Removes a station from the list of known devices
Resource-wide template parameters:
- {siteId}: site identification string.
- {mac}: the station’s pMAC address. The pseudo MAC address (pMAC) is a unique ID generated by the Bluetooth Beacon Tracker dashboard starting from the UUID, Major and Minor.
Accepted representations:
- No information is passed along with the request.
Example:
Remove the station with MAC address I072CF173037 from siteId=”1001″
curl -u username:password -X DELETE https://its.accuware.com/api/v1/sites/1001/stations/I072CF173037/
The result is a confirmation message:
{ "status": "success" }
/api/v1/sites/{siteId}/accounts/
GET
Retrieves all the user accounts associated to a site
Resource-wide template parameters:
- {siteId}: site identification string.
Available response representations:
- 200 OK – application/json.
- JSON representation of user accounts associated to a site.
[stextbox id=”grey”]
Example:
Retrieves a JSON representation of all the user accounts associated with siteId=”1001″:
curl -u username:password https://its.accuware.com/api/v1/sites/1001/accounts/
The result is a JSON Object:
[ { "username":"carlos@domain.net", "access":10 }, { "username":"cyril@domain.net", "access":20 }, { "username":"gianni@domain.net", "access":30 }, { "username":"francesco@domain.net", "access":30 } ]
JSON fields:
- username: username associated with the site.
- access: access levels for the username registered.
/api/v1/sites/{siteId}/levels/
GET
Returns all the levels for the current site
Resource-wide template parameters:
- {siteId}: site identification string.
Available response representations:
- 200 OK – application/json
- JSON array of levels associated to a site.
[stextbox id=”grey”]
Example:
Returns a JSON representation of all the levels for site with siteId=”1001″:
curl -u username:password https://its.accuware.com/api/v1/sites/1001/levels/
The result is an array [{…}, {…}, …] of JSON objects:
[ { "desc":"", "levelId":1, "alt":"NaN", "name":"First Floor" }, { "desc":"", "levelId":2, "alt":"NaN", "name":"Second Floor" }, { "desc":"", "levelId":3, "alt":"NaN", "name":"Penthouse" } ]
/api/v1/sites/{siteId}/levels/{levelId}/
GET
Returns a specific level for the current site
Resource-wide template parameters:
- {siteId}: site identification string.
- {levelId}: level identification string.
Available response representations:
- 200 OK – application/json.
- JSON representation of a level.
Example:
Returns a JSON representation of the level “1” for site with siteId=”1001″:
curl -u username:password https://its.accuware.com/api/v1/sites/1001/levels/1/
The result is an array [{…}, {…}, …] of JSON objects:
{ "desc":"", "levelId":1, "alt":"NaN", "name":"First Floor" }
JSON fields:
- desc: level’s description.
- levelID: level identification number.
- name: level’s name.
- alt: altitude – not used at present.
PUT
Create a new level for the site.
Resource-wide template parameters:
- {siteId}: site identification string.
- {levelId}: level identification string.
Accepted representations:
- application/x-www-form-urlencoded
Level information:
- The fields name, desc and alt can contain empty values.
[stextbox id=”grey”]
Example:
Create level with LevelID 11 in siteId 1001″:
curl -u username:password -X PUT -d "name=Level_11&desc=This is a new level" https://its.accuware.com/api/v1/sites/1001/levels/11/
The result is a JSON that describes the level just registered:
{ "desc": "This is a new level", "levelId": 11, "alt": "NaN", "name": "Level_11" }
DELETE
Remove a level from the selected site
Resource-wide template parameters:
- {siteId}: site identification string
- {levelId}: level identification string.
Accepted representations:
- No information is passed along with the request
[stextbox id=”grey”]
Example:
Remove the level with levelID 11 from siteId 1001:
curl -u username:password -X DELETE https://its.accuware.com/api/v1/sites/1001/levels/11/
The result is a confirmation message:
{ "status": "success" }
/api/v1/sites/{siteId}/floorplans/
GET
Returns all the floor plans for the current site
Resource-wide template parameters:
- {siteId}: site identification string.
Available response representations:
- 200 OK – application/json
- JSON array of floor plans
[stextbox id=”grey”]
Example:
Returns a JSON representation of all the floor plans for site with siteId=”1001″:
curl -u username:password https://its.accuware.com/api/v1/sites/1001/floorplans/
The result is an array [{…}, {…}, …] of JSON objects:
[ { "desc":"", "levelId":0, "kmlAligned":"https://s3.amazonaws.com/navizon.its.fp/1001/aaa1111_a.kml", "name":"First - Floor", "kml":"https://s3.amazonaws.com/navizon.its.fp/1001/aaa1111_o.kml", "access":"private", "fpId":"aaa1111" }, { "desc":"", "levelId":1, "kmlAligned":"https://s3.amazonaws.com/navizon.its.fp/1001/aaa2222_a.kml", "name":"Second - Floor", "kml":"https://s3.amazonaws.com/navizon.its.fp/1001/aaa2222_o.kml", "access":"private", "fpId":"aaa2222" } ]
JSON fields:
- desc:floor plan’s description.
- levelID: level associated to the floor plan.
- kmlAligned: link to the transformed KML file.
- name: floor plan’s name.
- kml: link to the original KML file.
- access: private (not relevant)
- fpID: floor plan identification string.
POST
Upload a floor plan within the current site.
Resource-wide template parameters:
- {siteId}: site identification string.
Accepted representations:
- form-data
Example:
Upload a floor planon the level 4 of site with siteId=”1001″:
curl --form username=its_username --form password=its_password --form levelId=4 --form name=Fourth Floor --form desc=Description --form kml=@Floorplan4.kml --form image=@Floor4.png -X POST https://its.accuware.com/api/v1/sites/1001/floorplans/
At the end of the upload process, you should display:
{"levelId":4,"fpId":"aatkhtv2n0","name":"Fourth Floor","access":"private","kml":"https://s3.amazonaws.com/navizon.its.fp/1001/aatkhtv2n0_o.kml","desc":"Description","kmlAligned":"https://s3.amazonaws.com/navizon.its.fp/1001/aatkhtv2n0_a.kml"}
/api/v1/sites/{siteId}/floorplans/{fpId}/
GET
Returns a specific floor plan for the current site
Resource-wide template parameters:
- {siteId}: site identification string.
- {fpId}: floor plan identification string.
Available response representations:
- 200 OK – application/json.
- JSON representation of a floor plan
[stextbox id=”grey”]
Example:
Returns a JSON representation of the floor plan “aaa1111″ for site with siteId=”1001”:
curl -u username:password https://its.accuware.com/api/v1/sites/1001/floorplans/aaa1111/
The result is an array [{…}, {…}, …] of JSON objects:
{ "desc":"", "levelId":0, "kmlAligned":"https://s3.amazonaws.com/navizon.its.fp/1001/aaa1111_a.kml", "name":"First - Floor", "kml":"https://s3.amazonaws.com/navizon.its.fp/1001/aaa1111_o.kml", "access":"private", "fpId":"aaa1111" }
JSON fields:
- desc:floor plan’s description.
- levelID: level associated to the floor plan.
- kmlAligned: link to the transformed KML file.
- name: floor plan’s name.
- kml: link to the original KML file
- access: private (not relevant)
- fpID: floor plan identification string.
/api/v1/sites/{siteId}/levels/{levelId}/metadata/
GET
Returns all the geo-fences for a specific level of a site
Resource-wide template parameters:
- {siteId}: site identification string.
- {levelId}: level identification string.
Available response representations:
- 200 OK – application/json.
- JSON representation of one or multiple geo-fences.
[stextbox id=”grey”]
Example:
Returns the JSON representation of the geo-fences related to level “1” of site “1001”:
curl -u username:password https://its.accuware.com/api/v1/sites/1001/levels/1/metadata/
The result is an array [{…}, {…}, …] of JSON objects:
[{ "id": "42", "levelId": 0, "behavior": "include", "class": "geometry", "type": "area", "vertexes": [ [ ["45.736722", "-0.577394"], ["45.736609", "-0.577539"], ["45.736557", "-0.577375"], ["45.736686", "-0.577309"] ] ], "name": "my geo-fence" }]
JSON fields:
- id: geo-fence identification number.
- levelID: level identification number.
- behavior: not relevant at present.
- class: not relevant at present.
- type: not relevant at present.
- vertex: array of coordinates that defines the area.
- name: geo-fence name. If no name was specified when creating, will be set to “”.
/api/v1/sites/{siteId}/metadata/
POST
Create a new geo-fence for a specific level of a site.
Resource-wide template parameters:
- {siteId}: site identification string.
Accepted representations:
- application/json
[stextbox id=”grey”]
Example:
Create a geo-fence on Level “1” of site “1001”:
curl -u username:password -H 'Content-Type:application/json' -X POST -d '{"levelId":0,"behavior":"exclude","name":"my geo-fence","class":"geometry","type":"area","vertexes":[[["45.736626","-0.577270"],["45.736562","-0.577211"],["45.736611","-0.577155"],["45.736685","-0.577198"]]]}' https://its.accuware.com/api/v1/sites/1001/metadata/
The result is a JSON that describes the geo-fence just created:
{ "id": "15", "levelId": 1, "behavior": "exclude", "name": "my geo-fence", "class": "geometry", "type": "area", "vertexes": [ [ [ "45.736626", "-0.577270" ], [ "45.736562", "-0.577211" ], [ "45.736611", "-0.577155" ], [ "45.736685", "-0.577198" ] ] ] }
JSON fields:
- id: geo-fence identification number.
- levelID: level identification number.
- behavior: not relevant at present.
- name: geo-fence name. If no name was specified when creating, will be set to “”.
- class: not relevant at present.
- type: not relevant at present.
- vertex: array of coordinates that defines the area.
DELETE
Delete all the geo-fences associated to a site.
Resource-wide template parameters:
- {siteId}: site identification string.
[stextbox id=”grey”]
Example:
Delete all the geo-fence inside site “1001”:
curl -u username:password -X DELETE https://its.accuware.com/api/v1/sites/1001/metadata/
The result is a confirmation message:
{ "status": "success" }
/api/v1/sites/{siteId}/metadata/{metadataId}/
PUT
Update an existing geo-fence defined by its ID
Resource-wide template parameters:
- {siteId}: site identification string.
- {metadataId}: geo-fence identification string.
Available response representations:
- application/json.
[stextbox id=”grey”]
Example:
Update an the geo-fence with ID “1” inside site “1001”:
curl -X PUT "http://its.accuware.com/api/v1/sites/1001/metadata/1/" -H 'Content-Type:application/json' -u username:password -d '{"id":"1","levelId":"3","behavior":"include","name":"my geo-fence","class":"geometry","type":"area","vertexes":[[["45.656369","9.414533"],["45.656361","9.414573"],["45.656329","9.414562"],["45.656337","9.414520"],["45.656350","9.414525"],["45.656353","9.414510"],["45.656373","9.414518"]]]}'
The result is a JSON that describes the geo-fence just modified:
{ "id":"15", "levelId":"3", "behavior":"include", "name":"Studio2", "class":"geometry", "type":"area", "vertexes":[ [ [ "45.656369", "9.414533" ], [ "45.656361", "9.414573" ], [ "45.656329", "9.414562" ], [ "45.656337", "9.414520" ], [ "45.656350", "9.414525" ], [ "45.656353", "9.414510" ], [ "45.656373", "9.414518" ] ] ] }
JSON fields:
- id: geo-fence identification number.
- levelID: level identification number.
- behavior: not relevant at present.
- class: not relevant at present.
- type: not relevant at present.
- vertex: array of coordinates that defines the area.
- name: geo-fence name. If no name was specified when creating, will be set to “”.
DELETE
Delete an existing geo-fence defined by its ID
Resource-wide template parameters:
- {siteId}: site identification string.
- {metadataId}: geo-fence identification string.
[stextbox id=”grey”]
Example:
Delete the geo-fence with ID “15” inside site “1001”:
curl -u username:password -X DELETE https://its.accuware.com/api/v1/sites/1001/metadata/15/
The result is a confirmation message:
{ "status": "success" }
Asynchronous Access (Callback Mechanism)
Resource | URI | Available HTTPS Methods |
---|---|---|
Callback list Management | https://its.accuware.com/api/v1/sites/{siteId}/callbacks/ | GET, PUT, DELETE |
Site level | https://its.accuware.com/api/v1/sites/{siteId}/callbacks/stations/ | GET |
Site level | https://its.accuware.com/api/v1/sites/{siteId}/callbacks/stations/{mac}/ | PUT, DELETE |
Node level | https://its.accuware.com/api/v1/sites/{siteId}/callbacks/nodes/ | GET |
Node level | https://its.accuware.com/api/v1/sites/{siteId}/callbacks/nodes/{node_mac}/ | GET |
Node level | https://its.accuware.com/api/v1/sites/{siteId}/callbacks/nodes/{node_mac}/stations/ | GET |
Node level | https://its.accuware.com/api/v1/sites/{siteId}/callbacks/nodes/{node_mac}/stations/{mac}/ | PUT, DELETE |
/api/v1/sites/{siteId}/callbacks/
GET
Retrieve the callback URL.
Resource-wide template parameters:
- {siteId}: site identification string.
Available response representations:
- 200 OK – application/json.
[stextbox id=”grey”]
Example:
Retrieve the callback URL registered with siteId=”1001″:
curl -u username:password https://its.accuware.com/api/v1/sites/1001/callbacks/
The result is a JSON Object:
{ "url": "https://my.domain.com/ItsPost.php" }
PUT
Register a callback URL.
Resource-wide template parameters:
- {siteId}: site identification string.
Accepted representations:
- application/x-www-form-urlencoded.
The callback URL will be passed in the callback field.
[stextbox id=”grey”]
Example:
Register “http://my.domain.com/ItsPost.php” as callback URL for siteId=”1001″.
curl -u username:password -X PUT -d "url=https://my.domain.com/ItsPost.php" https://its.accuware.com/api/v1/sites/1001/callbacks/
DELETE
Remove the callback URL and disable the notification system
Resource-wide template parameters:
- {siteId}: site identification string.
Accepted representations:
- No information is passed along with the request.
[stextbox id=”grey”]
Example:
Disable the callback system for siteId=1001:
curl -u username:password -X DELETE https://its.accuware.com/api/v1/sites/1001/callbacks/
/api/v1/sites/{siteId}/callbacks/stations/
GET
Retrieve the pseudo MAC addresses (or pMAC) of the stations registered in the callback list of a site.
Resource-wide template parameters:
- {siteId}: site identification string
Available response representations:
- 200 OK – application/json
[stextbox id=”grey”]
Example:
Retrieve the pseudo MAC addresses of all the stations registered in the callback list of the site 1001:
curl -u username:password https://its.accuware.com/api/v1/sites/1001/callbacks/stations/
The result is a JSON Object:
[ "I88796B734DF", "ID8796B734E4", "I78795B734D1" ]
/api/v1/sites/{siteId}/callbacks/stations/{mac}/
PUT
Register a station to the callbacks list of a site.
Resource-wide template parameters:
- {siteId}: site identification string.
- {mac}: the station’s pseudo MAC addresses.
Accepted representations:
- application/x-www-form-urlencoded
The callback URL will be passed in the callback field
[stextbox id=”grey”]
Example:
Register the station with MAC address I4:20:0C:27:E4:63 in the callback list of the site 1001:
curl -u username:password -X PUT https://its.accuware.com/api/v1/sites/1001/callbacks/stations/I4:20:0C:27:E4:63/
The result is a JSON Object:
{ "url": "https://my.domain.com/ItsPost.php" }
DELETE
Delete a station registered in a callback list of a site.
Resource-wide template parameters:
- {siteId}: site identification string.
- {mac}: the station’s pseudo MAC addresses.
Accepted representations:
- No information is passed along with the request.
[stextbox id=”grey”]
Example:
Delete the station with pseudo MAC addresses I4:20:0C:27:E4:63 from the callback list of the site 1001:
curl -u username:password -X DELETE https://its.accuware.com/api/v1/sites/1001/callbacks/stations/I4:20:0C:27:E4:63/
/api/v1/sites/{siteId}/callbacks/nodes/
GET
Retrieve the MAC addresses of the stations registered in the callback list of each BLE node.
Resource-wide template parameters:
- {siteId}: site identification string
Available response representations:
- 200 OK – application/json
[stextbox id=”grey”]
Example:
Retrieve the MAC addresses of all the stations registered in the callback list of each BLE node of site 1001:
curl -u username:password https://its.accuware.com/api/v1/sites/1001/callbacks/nodes/
The result is a JSON Object:
[ { "node": "7072CF21EB13", "stations": [ "IC867803BBA1", "IC867703BBA2", "IC867663BBA3", "IC8674033BA3" ] }, { "node": "7072CF21EB14", "stations": [ "IC833403BBA1", "IC8622403BBA2", "IC863403BBA3", "IC8674663BBA4" ] } ]
/api/v1/sites/{siteId}/callbacks/nodes/{node_mac}/
GET
Retrieve the pseudo MAC addresses of the stations registered in the callback list of a specific BLE node.
Resource-wide template parameters:
- {siteId}: site identification string.
- {node_mac}: BLE node’s MAC address.
Available response representations:
- 200 OK – application/json.
[stextbox id=”grey”]
Example:
Retrieve the pseudo MAC addresses of the stations registered in the callback list of the BLE node with MAC address 70:72:CF:21:EB:13 in the site 1001:
curl -u username:password https://its.accuware.com/api/v1/sites/1001/callbacks/nodes/70:72:CF:21:EB:13/
The result is a JSON Object:
[ "IC867803BBA1", "IC867703BBA2", "IC867663BBA3", "IC8674033BA3" ]
/api/v1/sites/{siteId}/callbacks/nodes/{node_mac}/stations/{mac}/
PUT
Register a station to the callbacks list of a specific BLE node.
Resource-wide template parameters:
- {siteId}: site identification string.
- {node_mac}: BLE node’s MAC address.
- {mac}: the station’s pseudo MAC address.
Accepted representations:
- No information is passed along with the request
[stextbox id=”grey”]
Example:
Register the station with pseudo MAC address I4:20:0C:27:E4:63 in the callback list of the BLE node with MAC address 18:87:96:B7:34:D1 in the site 1001:
curl -u username:password -X PUT https://its.accuware.com/api/v1/sites/1001/callbacks/nodes/18:87:96:B7:34:D1/stations/I4:20:0C:27:E4:63/
DELETE
Delete a station registered in a callback list of a specific BLE node.
Resource-wide template parameters:
- {siteId}: site identification string
- {node_mac}: node’s MAC address
- {mac}: the station’s pseudo MAC address
Accepted representations:
- No information is passed along with the request.
[stextbox id=”grey”]
Example:
Delete the station with pseudo MAC address I4:20:0C:27:E4:63 from the callback list of the BLE node with MAC address 18:87:96:B7:34:D1 in the siteId=1001:
curl -u username:password -X DELETE https://its.accuware.com/api/v1/sites/1001/callbacks/nodes/18:87:96:B7:34:D1/stations/I4:20:0C:27:E4:63/