Public API – POST Update Zone

The Zones endpoint allows existing Zones to be amended. Each Zone may contain one or many geofences, actions and conditions. Zone Id of the existing Zone must be provided for a successful update. If the Zone Id is not provided a new Zone will be created.

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
zoneId String The identifier of the Zone being updated  HHH:MM
minimumRetriggerTime String Minimum retrigger time (MRT) is the amount of time that needs to expire before the Zone retriggers actions for the same user. If Checkout is not enabled, the MRT starts after a user checks in at the Zone. For example, if you enter 10:00, actions will only retrigger when the user checks in at the same Zone after 10 hours. If Checkout is enabled, the MRT activates only after a checkout event has happened.  HH: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”. true/false
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. They 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.

image

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

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

{
    "security": {
        "customerApiKey": "bc199c80-5441-11e4-b7bb-a0481cdc3311",
        "apiKey": "d3161e80-38d1-11e4-b039-bc305bf60831"
    },
    "content": {
        "zone": {
            "zoneId": "24d9a245-2087-421b-9972-2af2ee0970f1",
            "zoneName": "High Accident Warning Zone - Updated",
            "minimumRetriggerTime": "00:06",
            "enableCheckOut" : false,
            "activeAllDay": true
        }
    }
}

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

Name
Required
Data Type
Description
Format
from Object API key for customer (rather than the app)
to Object API Key of the relevant app
time String Name given to the Zone  HH:MM
period String The identifier of the Zone being updated  am/pm
{
    "security": {
        "customerApiKey": "bc199c80-5441-11e4-b7bb-a0481cdc3311",
        "apiKey": "d3161e80-38d1-11e4-b039-bc305bf60831"
    },
    "content": {
        "zone": {
            "zoneId": "24d9a245-2087-421b-9972-2af2ee0970f1",
            "zoneName": "High Accident Warning Zone - Updated",
            "minimumRetriggerTime": "00:06",
            "enableCheckOut": false,
            "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": "24d9a245-2087-421b-9972-2af2ee0970f1",
    "name": "High Accident Warning Zone - Updated",
    "messageCode": 200
}

Source code examples

Created by Bluedot DevOps on March 5, 2018

Start the discussion