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

  • a set of Accuware credentials (username and password)
  • the siteID
  • the 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. If the station has been previously saved in the list of known devices, the returned object will also contain name and description fields.

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. 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 (and the RSS) 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:
  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 Wi-Fi Location Monitor REST API is using the command line tool cURL freely available at cURL is a command line tool for transferring data with URL syntax. To install and use cURL:

  1. Download cURL at this URL:
  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.
    • {mac}: with the MAC address  of the station registered with your Accuware site.
curl -u username:password{siteId}/stations/00:00:00:00:00:00/


Source code

NSString *site_id = @"0000";
NSString *station_mac = @"00:00:00:00:00:00";

NSURLCredential *credential = [NSURLCredential credentialWithUser: @"username"
														 password: @"password"
													  persistence: NSURLCredentialPersistenceForSession];

NSURLProtectionSpace *protectionSpace = [[NSURLProtectionSpace alloc] initWithHost: @"" 
																			  port: 80 
																		  protocol: @"http" 
																			 realm: @"Accuware Wi-Fi Location Monitor" 
															  authenticationMethod: NSURLAuthenticationMethodHTTPBasic];

[[NSURLCredentialStorage sharedCredentialStorage] setDefaultCredential: credential
													forProtectionSpace: protectionSpace];
[protectionSpace release];

NSURL *url = [NSURL URLWithString:[NSString stringWithFormat: @"",

NSURLRequest *urlRequest = [NSURLRequest requestWithURL: url];
NSURLResponse *response = nil;
NSError *error = nil;
NSData *data = [NSURLConnection sendSynchronousRequest:urlRequest returningResponse:&response error:&error];
NSDictionary *jsonObj = [NSJSONSerialization JSONObjectWithData: data options: NSJSONReadingMutableContainers error: &error];

NSLog(@"Station: %@", [jsonObj objectForKey:@"mac"]);
NSLog(@" %.6f", [[[jsonObj objectForKey: @"loc"] objectForKey: @"lat"] doubleValue]);
NSLog(@"loc.lng: %.6f", [[[jsonObj objectForKey: @"loc"] objectForKey: @"lng"] doubleValue]);


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

import org.json.JSONObject;
import org.restlet.ext.json.JsonRepresentation;
import org.restlet.resource.ClientResource;

public class ItsClient {

    private final static String BASE_URL = "";

    private final static String SITE_ID = "0000";                       // Your site ID here
    private final static String STATION_MAC = "00:00:00:00:00:00";      // The station's MAC address
    private final static String USERNAME = "username";                  // Your username
    private final static String PASSWORD = "password";                  // Your password

    public static void main(String[] args) throws Exception {

        // Set the request parameters
        String url = BASE_URL + "sites/" + SITE_ID + "/stations/" + STATION_MAC + "/";
        ClientResource itsClient = new ClientResource(url);
        itsClient.setChallengeResponse(ChallengeScheme.HTTP_BASIC, USERNAME, PASSWORD);

        // Retrieve and parse the JSON representation
        JsonRepresentation jsonRep = new JsonRepresentation(itsClient.get());
        JSONObject jsonObj = jsonRep.getJsonObject();

        // Output results
        System.out.printf("Station: %s\n", jsonObj.getString("mac"));
        System.out.printf(" %.6f\n", jsonObj.getJSONObject("loc").getDouble("lat"));
        System.out.printf("loc.lng: %.6f\n", jsonObj.getJSONObject("loc").getDouble("lng"));


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

Source Code

using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.IO;
using Newtonsoft.Json.Linq;

namespace ItsClient
    class Program
        private const string BASE_URL = "";

        private const string SITE_ID = "0000";                       // Your site ID here
        private const string STATION_MAC = "00:00:00:00:00:00";      // The station's MAC address
        private const string USERNAME = "username";                  // Your username
        private const string PASSWORD = "password";                  // Your password

        static void Main(string[] args)
            // Set the request parameters
            string url = BASE_URL + "sites/" + SITE_ID + "/stations/" + STATION_MAC + "/";
            HttpWebRequest webreq = (HttpWebRequest)System.Net.HttpWebRequest.Create(url);
            string authInfo = Convert.ToBase64String(Encoding.Default.GetBytes(USERNAME + ":" + PASSWORD));
            webreq.Headers["Authorization"] = "Basic " + authInfo;

            // Retrieve and parse the JSON representation
            StreamReader strReader = new StreamReader(webreq.GetResponse().GetResponseStream());
            String response = strReader.ReadToEnd();
            JObject jsonObj = JObject.Parse(response);

            // Output results
            Console.Out.WriteLine("Station: " + (string) jsonObj["mac"]);
            Console.Out.WriteLine(" " + (double) (jsonObj["loc"])["lat"]);
            Console.Out.WriteLine("loc.lng: " + (double) (jsonObj["loc"])["lng"]);


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

gem install json

Source Code

require 'rubygems'
require 'json'
require 'net/http'

SITE_ID = '0000'                       # Your site ID here
STATION_MAC = '00:00:00:00:00:00'      # The station's MAC address
USERNAME = 'username'                  # Your username
PASSWORD = 'password'                  # Your password

Net::HTTP.start(SERVER) {|http|

    # Set the request parameters
    req ="/api/v1/sites/#{SITE_ID}/stations/#{STATION_MAC}/")
    req.basic_auth USERNAME, PASSWORD

    # Retrieve and parse the JSON representation
    response = http.request(req)
    obj = JSON.parse(response.body)

    # Output the results
    puts "Station: #{obj['mac']}"
    puts " #{obj['loc']['lat']}"
    puts "loc.lng: #{obj['loc']['lng']}"


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

<!DOCTYPE html>
    <title>Accuware Wi-Fi Location Monitor Javascript Example</title>
    <script type="text/javascript" src=""></script>
    <script type="text/javascript" src="Base64.js"></script>

    <h1>Accuware Wi-Fi Location Monitor Javascript Example</h1>

    <div id="results"></div>

    <script type="text/javascript">

        $(document).ready(function() {

            var BASE_URL = "",
                SITE_ID = "0000",                       // Your site ID here
                STATION_MAC = "00:00:00:00:00:00",      // The station's MAC address
                USERNAME = "username",                  // Your username
                PASSWORD = "password";                  // Your password

            // Send the request
   = true;     // enable cross-site scripting

                type: "GET",
                url: BASE_URL + "sites/" + SITE_ID + "/stations/" + STATION_MAC + "/",
                beforeSend: function(jqXHR) {
                    jqXHR.setRequestHeader("Authorization", "Basic " + Base64.encode(USERNAME + ":" + PASSWORD));
                success: function(station) {
                    // Output the results
                    if (typeof station === "string") {
                        station = JSON.parse(station);
                            "Station: " + station.mac + "<br />" +
                            " " + + "<br />" +
                            "loc.lng: " + station.loc.lng + "<br />"
                error: function(jqXHR, textStatus, errorThrown) {