Skip to end of metadata
Go to start of metadata

This documentation is no longer actively supported and may be out of date. Going forward, please visit and bookmark our new site (https://docs.phunware.com/) for up-to-date documentation.

Retrieve Location Data

 

This method is used to return a device's location coordinates and venue map data.

Method

GET

URL

http://location-api.phunware.com/v1.2/coordinates

Headers

X-Auth (see Security)

Query Parameters

Required parameters are underlined.

Parameter

Value

Description

macAddress

string

The hashed MAC address of the device requesting coordinates, obfuscated using the HMAC SHA-256 algorithm.

An example MAC address of "01:23:45:6", when hashed using http://www.movable-type.co.uk/scripts/sha256.html, results in: "8e6549939116b0ae0c4c6997355ba6086a81799f27c97711de5003026dbcc0d9".)

venueGuid

string

The identifier of the venue to retrieve map data from.

Example Query Fragment

{
	"macAddress": "8e6549939116b0ae0c4c6997355ba6086a81799f27c97711de5003026dbcc0d9", 
	"venueGuid": "e2a53fd8-6dcc-48e1-8b33-71f12fc13966"
}

URL-encoded, minified fragment:

%7B%22macAddress%22%3A%228e6549939116b0ae0c4c6997355ba6086a81799f27c97711de5003026dbcc0d9%22%2C%22venueGuid%22%3A%22e2a53fd8-6dcc-48e1-8b33-71f12fc13966%22%7D

Example Request

GET
http://location-api.phunware.com/v1.2/coordinates?%7B%22macAddress%22%3A%228e6549939116b0ae0c4c6997355ba6086a81799f27c97711de5003026dbcc0d9%22%2C%22venueGuid%22%3A%22e2a53fd8-6dcc-48e1-8b33-71f12fc13966%22%7D

Response

A successful response will have a 200 status code and a body containing location data:

{
    "buildingId": <integer>,
    "floorId": <integer>,
    "level": <integer>,
    "macAddress": <string>,
    "x": <float>,
    "y": <float>,
    "location": 
	{
        "latitude": <float>,
        "longitude": <float>,
        "accuracy": <integer>
    },
    "updatedAt": <string>
}

See Location API Response Handling for error payloads.

Example Response

Example body of a successful response:

{
    "buildingId": 32,
    "floorId": 45,
    "level": 2,
    "macAddress": "8d969eef6ecad3c29a3a629280e686cf0c3f",
    "x": 40.59,
    "y": 39.49,
    "location": 
	{
        "latitude": 30.35999462,
        "longitude": -97.74246194,
        "accuracy": 123
    },
    "updatedAt": "2002-10-02T10:00:00Z"
}

ON THIS PAGE

 

 

 

 

 

  • No labels