Public API – POST Create Zone

The Zone end point allows new Zones to be created within a particular Application. Each Zone may contain one or more Geofences, GEOLINE™, Bluetooth Beacons, Actions and/or Conditions.

URL to call

https://api.bluedotinnovation.com/1/zones

Content Type

The content type should be specified in the Content-Type HTTP header as “application/json”.

image

Content-Type: application/json

Parameters

No URL Parameters required. See example JSON below.

Key JSON fields

Name
Required
Data Type
Description
Format
customerApiKey String API key for customer (rather than the app).
apiKey String API Key of the relevant app.
zoneName String Name given to the Zone.
minimumRetriggerTime String Minimum Re-trigger Time (MRT) is utilized to preclude unwanted, multiple triggers within a Zone. This can be due to, for example, a user remaining stationary after a trigger. HHH:MM
timeActive Object Outside this time range, actions will not trigger when a user enters a Zone; allowing for significant battery saving. Time must use a 12 hour clock, with the period supplied as “am” or “pm”.
activeAllDay Boolean Active All Day option will keep the Zone active throughout the day. (Either activeAllDay or timeActive field needs to be provided in the request JSON. Both cannot be used together.) true/false
enableCheckOut Boolean Marks Zone as a checkout Zone. When a device exits a fence or the range of a beacon, a custom action will be triggered. In a checkout Zone, Minimum Retrigger Time applies only after a device checks out of a fence or beacon. By default enableCheckOut is false. true/false

Checkout is not applicable for GEOLINE™. The checkout feature is only available in SDK version 1.6 and above.

Example: JSON request to create a Zone which will be active all day

{
    "security": {
        "customerApiKey": "4d3a1b60-4dc4-11e4-ad0a-a0481cdba483",
        "apiKey": "77c16870-360a-492b-84c6-d1790abe9cc0"
    },
    "content": {
        "zone": {
            "zoneName": "High Accident Warning Zone",
            "minimumRetriggerTime": "00:06",
            "enableCheckOut" : false,
            "activeAllDay": true
        }
    }
}

Example: JSON request to create a Zone which will be active between 09:00 AM – 11:00 AM

Name
Required
Data Type
Description
Format
from Object The start time from when the Zone should be active from.
to Object The end time after when the Zone should not be active.
time String Time must use a 12 hour clock. HH:MM
period String The Time period of the day. am/pm
{
    "security": {
        "customerApiKey": "4d3a1b60-4dc4-11e4-ad0a-a0481cdba483",
        "apiKey": "77c16870-360a-492b-84c6-d1790abe9cc0"
    },
    "content": {
        "zone": {
            "zoneName": "High Accident Warning Zone",
            "minimumRetriggerTime": "00:06",
            "enableCheckOut" : true,
            "timeActive": {
                "from": {
                    "time": "09:00",
                    "period": "am"
                },
                "to": {
                    "time": "11:00",
                    "period": "am"
                }
            }
        }
    }
}

Example: JSON response to request

{
    "message": "Your request has been successfully processed.",
    "zoneId": "cc6f9dd1-3d69-454d-abdd-58176cbf67dc",
    "name": "High Accident Warning Zone",
    "messageCode": 200
}

Source code examples

Created by Bluedot DevOps on January 17, 2018

Start the discussion