The Accuware Wearabouts API allows to download easily the historical locations of the Wearabouts devices registered within a specific site. Here you can find the 2 different calls that can be issued:

1 – KML/CSV logging service

The KML/CSV logging service is activated upon your explicit request and NOT by default with a Wearabouts account. In order to activate the logging service please submit a support request using this form and let us know the list of sites for which you want to activate the KML/CSV logging service. The KML/CSV logging service will be activated within 24 hours from your request.

navimote2.navizon.com/api/v1/sites/{siteID}/devices/{deviceID}/log/?fmt=[kml|csv]&h=TimeBack&
tz=TimeZoneDifference

GET

Retrieves the historical locations of an  Android/iOS devices or Smart Tag registered within a specific site.

Resource-wide template parameters:

  • {siteId}: site identification string.
  • {deviceId}: device identification string.

Query parameters:

  • fmt [kml | csv]: is the format and can be equal to CSV or KML (default: csv).
  • h: number of seconds back in the history (default: 1209600 seconds [14 days] in the past).
  • tz: timezone as string (e.g. GMT-4 or GMT%2B4). All times are shown by applying the tz delta. In case of positive time differences you need to urlEncode the „+“ to %2B (default: 0). Does not apply to the CSV fmt.

Example KML

Download the KML of the locations computed for the last 60 seconds for the Smart Tag with MAC 54FB58001265 inside site 1001 (located at timezone GMT+2) using cURL (to issue API call and retrieve the KML using other tools please look at this article):

The KML file downloaded will look like this:

The file can be opened on Google Earth which is freely available at this link or it can be opened with a text editor. When opening the file with Google Earth it is possible to find 5 folders <Folder>:

  1. GLOBAL – contains the locations computed using the Navizon Global database of cell towers and WiFi access points
  2. Indoors – contains the locations computed using the WiFi or Bluetooth fingerprints collected indoor – Bluetooth not relevant to the Smart Tags.
  3. Core – contains the locations provided by the Core location of the Android device – not relevant to the Smart Tags.
  4. Camera – contains the locations computed using the camera fingerprints – not relevant to the Smart Tags.
  5. Position – contains the locations chosen as the best one among the 4 locations above (the one with the smaller radius of confidence)

For each one of the locations <Placemark> inside the 4 folders it is possible to find:

  • the name of the placemark (e.g. <name>#2 Core</name>)
  • the description of the placemark with:
    • the date and time (e.g. DATE: 2016-07-28T15:06:10+0200)
    • the radius of confidence [meters] (e.g. ROC: 3500.00)  – if applicable
    • the list of scans (e.g. 1,222,99,20316,9976058,-69;
      0,00:72:CF:4F:68:BB,-38,0;
      0,00:8C:54:93:9E:70,-72,0;
      0,90:35:6E:FB:1E:28,-90,0;)  – if applicable
    • the level  – if applicable
  • the date and time (e.g.  <TimeStamp> <when>2016-07-28T15:06:10+0200</when> </TimeStamp>)
  • the coordinates ( e.g. <Point> <coordinates>9.460634, 45.648950</coordinates> </Point>)

 

Example CSV

Download the CSV of all the locations computed by the Accuware Wearabouts server during the last 14 days for the Smart Tag with MAC 54FB58001265 inside site 1001 using cURL (to issue API call and retrieve the CSV using other tools please look at this article):

The “timezone” parameter (tz) is not kept into account as explained above.

The CSV file downloaded will look like this:

You can open the CSV file with a spreadsheet editor following one of the many tutorials online (please be aware that the CSV fields are separated with character “|” ). At this link you can find an XLS template that you can use to import your CSV files. The CSV files contains the following 18 fields:

  1. Timestamp (Unix Epoch – see below)
  2. the list of scans sent to the Wearabouts server (WiFi, Bluetooth, cell towers signals)
  3. GLOBAL – Latitude
  4. GLOBAL – Longitude
  5. GLOBAL – radius of confidence [meters]
  6. INDOORS – Latitude
  7. INDOORS – Longitude
  8. INDOORS – radius of confidence [meters]
  9. INDOORS – level
  10. CORE – Latitude
  11. CORE – Longitude
  12. CORE – radius of confidence [meters]
  13. CORE – Timestamp (Unix Epoch – see below)
  14. CAMERA – Latitude
  15. CAMERA – Longitude
  16. CAMERA – radius of confidence [meters]
  17. CAMERA – level
  18. the chosen source of location. When multiple location sources are available, the Wearabouts engine chooses the source with:
    • the most recent time-stamp. The time-stamp related to one location is better then all the others if it is at least 15 seconds greater than the time-stamps of all the other locations.
    • or the higher accuracy (smaller radius of confidence) when there are multiple locations with time-stamps that do not differ for more than 15 seconds.

Unix epoch timestamp: the Unix epoch (or Unix time or POSIX time or Unix timestamp) is the number of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap seconds (in ISO 8601: 1970-01-01T00:00:00Z):

  • More information about the Unix epoch timestamp can be found in this page.
  • More information about how to convert epoch to human readable date and vice versa can be found in this page.

2 – JSON logging service

The JSON logging service is activated by enabling the History switch of the Accuware dashboard under Wearabouts > History.

logger.accuware.com/api/v1/navimote/sites/{siteID}/years/{YYYY}/
months/{MM}/days/{dd}/devices/

GET

Retrieves the historical locations of ALL the Android/iOS devices/Smart Tag registered within a specific site for a specific date.

Resource-wide template parameters:

  • {siteId}: site identification string.
  • {YYYY}: year of interest.
  • {MM}: month of interest.
  • {dd}: day of interest.

IMPORTANT:

If the API call is issued for the current date then the result is returned as a plain JSON (like in the example below).

If the API call is issued for a past date then the result is a JSON object like this

  • { “url”:”https://s3.amazonaws.com/accuware.logger.sites/1333/2017/06/30/1333_2017_06_30.json.gz?AWSAccessKeyId=AdIAJLSVH7I2IAD456AAA4XK5A&Expires=1499073278&Signature=ADffoD%2BqKL3OnAdfgey7h2ZhTcEGQk%3D” }

The URL returned is already authenticated, so there is no need to do any authentication. In fact you can paste the URL in your browser and download the file. The URL returned will expire after 10 minutes, so you have to use it right after calling.

Example

Download the JSON of the locations computed for June 30th, 2017 for all the Wearabouts devices inside site 1001 using cURL (to issue API call and retrieve the JSON using other tools please look at this article):

The JSON file downloaded will look like this:

JSON fields:

  • position:
    • precision: an estimated radius of confidence where the device can be found.
    • siteID: site identification.
    • source: source location type:
      • N3 – this location is computed by using the database of fingerprints available if an indoor fingerprinting has been performed.
      • N1 – this location is computed by using the Navizon global database of Wi-Fi APs and Cell-IDs throughout the world. More information available here.
      • Core – this location is provided by the Android or iOS location manager.
    • levelID: last level identification.
    • fixed_at: last location fix.
    • device: device identifier.
    • lng: longitude.
    • deviceId: device identifier.
    • lat: latitude.
  • current_server_time: server timestamp when the query was made.
  • utc_offset_min: timezone difference from the UTC (aka GMT) timezone in minutes.
  • device_type:
    • NZ002.2 for the Smart Tags.
    • NWA1 for Android devices.
    • NWA2 for iOS devices.
  • udo:
    • name: device name assigned using the Accuware dashboard.
    • desc: device description assigned using the Accuware dashboard.
    • type: not used.
  • mac: device identifier.
  • device status:
    • device_events:
      • panic (only for Smart Tags): timestamp of the last button press.
      • moving: timestamp of the last movement.
      • pwr_up (only for Smart Tags): timestamp of the last activation of the Smart Tag.
    • received_at: timestamp of the last status.
    • type_of_device: the device capabilities are wifi (Smart Tag), or wifi,gsm,gps (for Android devices).
    • fw_version: firmware version.
    • battery: estimated battery percentage. Value with minus (-) means that the battery is charging.
  • deviceId: device identifier.
  • timezone_label: identifier of the time zone.