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.

Register with MARS, Obtain a MAC Address

 

This method is used to register with MARS and attempt to retrieve the hashed MAC address.

Method

POST

URL

http://localhost:8889/mars-api.phunware.com/v1.1/client

Request Body

Required parameters are underlined.

Parameter

Value

Description

timestamp

string

The date and time in RFC 3339. See MARS API Architecture > Date / Time Format.

schemaVersion

string

Specifies the version of input schema to be used.

device

object

An object containing key-value pairs. Required keys are underlined:

  • deviceId (string): The unique identifier for a registered device.
  • apBSSID (string): The AP BSSID of the Wi-Fi access point. If neither the AP BSSID nor IP address is provided, then service will do a MAC address lookup for a given device ID.
  • ipAddress (string): The device's IP address. If neither the AP BSSID nor IP address is provided, then service will do a MAC address lookup for a given device ID.
  • platformId (string): The OS version. Accepted values: "iOS", "Android"

app

object

An object containing key-value pairs. Required keys are underlined:

  • applicationId (string): The identifier of the MaaS application.
  • venueId (string): The identifier of the venue. Obtained from the mapping API call.
{
    "timestamp": <string>,
    "schemaVersion": <string>,
    "device": 
	{
        "deviceId": <string>,
        "apBSSID": <string>,
        "ipAddress": <string>,
        "platformId": <string>
    },
    "app": 
	{
        "applicationId": <string>,
        "venueId": <string>
    }
}

Example Request

POST the following request body to: http://mars-api.phunware.com/v1.1/client/

{
    "timestamp": "2008-09-08T22:47:31Z",
    "schemaVersion": "1.0",
    "device": 
	{
        //This example is using the Android-formatted device ID.
		//iOS devices use the UUID format for their device IDs.
		//(e.g."25644720-8CED-4E40-96F5-16102F90D2A8") 
		"deviceId": "9161ade538b097cb",
        "apBSSID": "00:11:22:33:44:55:66",
        "ipAddress": "192.168.0.10",
        "platformId": "android"
    },
    "app": 
	{
        "clientId": "244",
        "venueGuid": "7b99ab29-4a74-44f6-b849-8da662205552"
    }
}

Response

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

{
    "data": 
	{
        "hashedMACAddress": <string>,
        "deviceId": <string>
    }
}

See MARS API Response Handling for error payloads.

Example Response

Example body of successful response:

{
    "data": 
	{
        "hashedMACAddress": "099a490bfd494a071eea20dd66d5780dd260c7",
        "deviceId": "9161ade538b097cb"
    }
}

Hashing

The device MAC address returned to the client is obfuscated using the HMAC SHA-256 algorithm.

ON THIS PAGE

 

 

 

 

 

  • No labels