This page describe how to retrieve the real-time location of a station using the REST API provided by Accuware Indoor Tracking. To run these examples you need:

  • a set of Accuware credentials (username and password)
  • the siteID
  • the pMAC (pseudo MAC address) of the station registered with your Accuware site.

These information are used to create the URL for the request. The URL provides access to a JSON representation of the last station position.

HTTP 404 – Not Found: querying a station that was not active in the site for the past two hours and not registered in the list of known devices will cause the server to return a HTTP 404 – Not Found status code.

Browser access

For debugging and testing, you can retrieve the location of a device using a browser. We recommend installing a plugin such as:

After you have installed the plugin, simply:

  1. type the URL in the image below with your siteID and the MAC address of the station.
  2. and supply your Accuware credentials when prompted.

Accuware Wi-Fi Location Monitor API - browser access

RESTful client (for Chrome)

POSTman is a powerful HTTP client to help test web services easily and efficiently. POSTman can be easily downloaded from the Chrome Webstore at this link.

To retrieve  the location of the station with MAC address E8:92:A4:99:36:F9 inside site 1001, you have to:

  1. Install POSTman from the link above and access the POSTman app in Chrome by clicking the Apps button (located in the top-left corner of your browser) and the Postman – REST Client icon.
  2. Insert the following URL into the Enter request URL here text field: https://its.accuware.com/api/v1/sites/1001/stations/E8:92:A4:99:36:F9/
  3. Choose GET from the drop-down menu.
  4. Click on the button URL params.
  5. Click on the Basic Auth tab.
    • Username: your_username.
    • Password: your_password.
  6. Click on the Refresh Header button.
  7. Click on Send.

cURL (command line)

Another easy way to access the Indoors for Tracking REST API is using the command line tool cURL freely available at https://curl.haxx.se/. cURL is a command line tool for transferring data with URL syntax. To install and use cURL:

  1. Download cURL at this URL: https://curl.haxx.se/download.html
  2. Unzip cURL in a folder on your PC (e.g. C:\curl).
  3. Open a shell/command line and go in the cURL folder (e.g. C:\curl).
  4. Type the following string in your shell substituting:
    • username, password and {siteId} with the information provided in the Accuware Activation email.
    • {pMac}: with the pseudo MAC address of the station registered with your Accuware site.

Objective-C

Source code

Java

The Restlet framework provides a convenient access the API from Java. Download the Java SE edition archive and extracts the files in a directory of your choice.

Locate and add to your CLASSPATH the following JAR files:

Source Code

C#

The C# example uses JSON.NET to parse the response. The library is available at json.codeplex.com.

Source Code

Ruby

This example uses the JSON library for Ruby available as a gem:

Source Code

HTML/Javascript

The source code for the Base 64 library is available at this page. To run this example save the code in a file named Base64.js in the same directory as the HTML file below.

Source Code