Location

Create

Create Location

POST /api/create-or-update-location

Auth [Identifier], Scope [User]

Params

NameRequiredTypeDefaultComment
identifieryesstring
location_nameyesstring
address1yesstring
townyesstring
stateyesstring
zipcodeyesstring
countryyesstring
phone_numberyesstring
timezoneyesstring

Notes:

  • phone_number The phone_number format should be (YYY)ZZZ-XXXX
  • country The country code in ISO ALPHA-2 Code (ex. Canada is CA)
  • timezone The timezone for Toronto is America/Toronto - unicode timezone list: http://unicode.org/repos/cldr/trunk/common/supplemental/windowsZones.xml

Success [200]

{
    "status": "success",
    "message": "Location has been successfully created.",
    "location_id": [location_id]
}

Error [400]

{
"status": "error",
"message": {
        [error_msgs]
    }
}

Update

Update Location

POST /api/create-or-update-location

Auth [Identifier], Scope [Location]

Params

NameRequiredTypeDefaultComment
identifieryesstring
location_idyesinteger
location_nameyesstring
address1yesstring
townyesstring
stateyesstring
zipcodeyesstring
countryyesstring
phone_numberyesstring
timezoneyesstring

Notes:

  • location_id The location_id must be a Location ID# from the MyWiFi Dashboard if you want to update an existing location
  • phone_number The phone_number format should be (YYY)ZZZ-XXXX
  • country The country code in ISO ALPHA-2 Code (ex. Canada is CA)
  • timezone The timezone for Toronto is America/Toronto - unicode timezone list: http://unicode.org/repos/cldr/trunk/common/supplemental/windowsZones.xml

Success [200]

{
    "status": "success",
    "message": "Location has been successfully updated.",
    "location_id": [location_id]
}

Error [400]

{
"status": "error",
"message": {
        [error_msgs]
    }
}

Retrieve

Retrieve data for a Location

GET /api/get-location

Auth [Identifier], Scope [Location]

Params

NameRequiredTypeDefaultComment
identifieryesstring
location_idsyesstring

Notes:

  • location_ids The location_ids is either a single location_id integer or a comma separated list of location_ids [maximum 10 location_ids]

Success [200]

{
    "status": "success",
    "data": [
       "id": "[campaign-id]",
       "name": "[Location Name]",
       "location": "[Lat/Long]",
       "address": "[Address]",
       "city": "[City]",
       "zip": "[Zip]",
       "state": "[State]",
       "country": "[Country]",
       "phone_number": "[Phone Number]",
       "url": "[URL]",
       "website": "[Website URL]",
       "time_zone": "[Time Zone]",
       "date_created": "[datetime]",
       "last_modified": "[datetime]",
       "deleted": "[0|1]"
    ]
}

Error [400]

{
"status": "error",
"message": {
        [error_msgs]
    }
}

Delete

Delete Location

POST /api/delete-location

Identifier, Auth[API], Scope [Location]

Params

NameRequiredTypeDefaultComment
identifieryesstring
location_idyesinteger

Notes:

  • location_id The location_id must be a Location ID# from the MyWiFi Dashboard

Success [200]

{
    "status": "success",
    "message": "Location has been successfully deleted."
}

Error [400]

{
"status": "error",
"message": {
        [error_msgs]
    }
}

Campaign Assign

Assign Default Campaign to Location

POST /api/location-assign-campaign

Auth [Identifier], Scope [Location|Campaign]

Params

NameRequiredTypeDefaultComment
identifieryesstring
location_idyesinteger
campaign_idyesinteger

Notes:

  • location_id The location_id must be a Location ID# from the MyWiFi Dashboard or 0 (to disassociate a Device from any Location set the location_id to 0)
Success [200]
{
    "status": "success",
    "message": "Campaign has been successfully assigned to Location."
}
Error [400]
{
"status": "error",
"message": {
        [error_msgs]
    }
}

Device Assign

Assign Device to Location

POST /api/device-assign-location

Auth [Identifier], Scope [Location|Device]

Params

NameRequiredTypeDefaultComment
identifieryesstring
location_idyesinteger
device_idyesinteger

Notes:

  • location_id The location_id must be a Location ID# from the MyWiFi Dashboard or 0 (to disassociate a Device from any Location set the location_id to 0)

Success [200]

{
    "status": "success",
    "message": "Device has been successfully assigned to Location."
}

Error [400]

{
"status": "error",
"message": {
        [error_msgs]
    }
}

Devices List

List all Devices assigned to Location

GET /api/get-location-devices

Auth [Identifier], Scope [User]

Params

NameRequiredTypeDefaultComment
identifieryesstring
location_idyesinteger

Success [200]

{
"status": "success",
    "devices": [
        {
            "id": "[device_id]",
            "name": "[device name]",
            "mac_address": "4c5e0cf192b3",
            "model": "[model]",
            "status": "[status]",
            "live_status": "[live status]",
            "firmware_version": [firmware version],
            "upgrade": "[upgrade status]",
            "sync_response": [sync response],
            "status_created_on": [status datetime]
        }
    ]
}

Error [400]

{
"status": "error",
"message": {
        [error_msgs]
    }
}

Retrieve Session & Bandwidth

Retrieve Location Options / Settings [RADIUS Attributes]

GET /api/get-location-options

Auth [Identifier], Scope [Location]

Params

NameRequiredTypeDefaultComment
location_idyesinteger
{
"status": "success",
{   “data”: {
        "location_id": "[LocationID]",
        "session_time_limit": {
            "state": [true|false],
            "value": "[seconds]"
        },
        "daily_bandwidth_cap": {
            "state":  [true|false],
            "value": [bytes]
        },
        "content_filter": {
            "state":  [true|false]
        },
        "bandwidth_throttle_upanddown": {
             "state_up":  [true|false],
             "state_down":  [true|false],
             "value": {
                "up": "[bytes]",
                "down": "[bytes]"
             }
        }
        “dns_server_1”:””,
        “dns_server_1”:””,
        “blacklist”:””,
        “whitelist”:””
   }
}

Error [400]

{
"status": "error",
"message": {
        [error_msgs]
    }
}

Update Session & Bandwidth

Update Location Options / Settings [RADIUS Attributes]

POST /api/set-session-and-bandwidth-info

Auth [Identifier], Scope [Location]

Params

NameRequiredTypeDefaultComment
location_idyesinteger
session_time_limitnointeger0
max_bandwidthnointeger0
max_bandwidth_upnointeger0
daily_bandwidth_capnointeger0
content_filternobool0true,false
{
    "status": "success",
    "message": "Location Session and Bandwidth Info has been set."
}

Error [400]

{
"status": "error",
"message": {
        [error_msgs]
    }
}