Public API – POST Update Complete Zone

The Zones endpoint 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.

Now we allow to create a complete Zone with Fences, Actions and Beacons in a single JSON request to the endpoint.

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

N/A

image

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

Example: JSON request to create a complete Zone which will be active all day with a circular Geofence and a Message Action

{
    "security": {
        "customerApiKey": "4d3a1b60-4dc4-11e4-ad0a-a0481cdba483",
        "apiKey": "77c16870-360a-492b-84c6-d1790abe9cc0"
    },
    "content": {
        "zone": {
            "zoneId": "669f7c7c-b909-4d96-942c-25b85a33e582",
            "zoneName": "High Accident Warning Zone",
            "minimumRetriggerTime": "00:06",
            "enableCheckOut" : false,
            "activeAllDay": true,
            "fences": {               
                "circles": [
                    {
                        "fenceId": "162b89f3-c913-44cf-8b41-90332f7b47fa",
                        "name": "Test Circular fence with 8M radius",
                        "color": "#000fff",
                        "radius": 8,
                        "center": {
                            "latitude": -37.8159544565362,
                            "longitude": 144.9723565578461
                        }
                    }
                ]
            },
            "actions": {               
                "messageActions": [
                    {
                        "actionId": "d13007f0-9480-46b8-8f80-765203d91379",
                        "title": "Welcome to Bluedot Innovation",
                        "message": "Welcome to Bluedot Innovation Offices"
                    }
                ]
            }
        }
    }
}

Response: JSON response to request 

{
    "message": "Your request has been successfully processed.",
    "zoneId": "cc6f9dd1-3d69-454d-abdd-58176cbf67dc",
    "name": "High Accident Warning Zone",
    "fences":[ 
        { 
            "fenceName":"Test Circular fence with 8M radius",
            "fenceId":"c8873345-47eb-4e72-abde-eb6b1215a721"
        }
    ],
    "actions":[ 
        { 
            "actionId":"5de462f1-4899-4f19-90b1-d3b9f90da127",
            "actionName":"A Message Action"
        }
    ],
    "beacons":[],
    "messageCode": 200
}

Example: JSON request to create a complete Zone which will be active between 09:00 AM – 11:00 AM with a Beacon and a Custom Action

{
    "security": {
        "customerApiKey": "4d3a1b60-4dc4-11e4-ad0a-a0481cdba483",
        "apiKey": "77c16870-360a-492b-84c6-d1790abe9cc0"
    },
    "content": {
        "zone": {
            "zoneId": "aa4dea5b-5b54-4fb6-8df0-d74432c1be2a",
            "zoneName": "High Accident Warning Zone",
            "minimumRetriggerTime": "00:06",
            "enableCheckOut" : true,
            "timeActive": {
                "from": {
                    "time": "09:00",
                    "period": "am"
                },
                "to": {
                    "time": "11:00",
                    "period": "am"
                }
            },
            "beacons": [
                {
                    "beaconId": "b7db6f18-6557-4903-b0a7-b35b96d54fec",
                    "proximity": 2
                }
            ],
            "actions": {
                "customActions": [
                    {
                        "actionId": "0268df4d-1d76-4664-aa79-849ca619bef3",
                        "customFields":[
                            {
                                "key":"Store Type",
                                "value":"Coffee Shop"
                            },
                            {
                                "key":"Name",
                                "value":"Blue Bottle Coffee"
                            },
                            {
                                "key":"ID",
                                "value":"48707775-4991-434b-ba3a-f41ac1236c44"
                            }
                        ]
                    }
                ]
            }
        }
    }
}

Response: JSON response to request

{
    "message": "Your request has been successfully processed.",
    "zoneId": "cc6f9dd1-3d69-454d-abdd-58176cbf67dc",
    "name": "High Accident Warning Zone",
    "fences":[],
    "actions":[ 
        { 
            "actionId":"e5be998c-9cc0-4f04-85c4-fc4337763cc8",
            "actionName":"A Custom action"
        }
    ],
    "beacons":[
        "beaconId":"7cfc29cc-0679-46cf-83a1-0f9870d8440d"
    ],
    "messageCode": 200
}

Source code examples

Created by Bluedot DevOps on March 5, 2018

Start the discussion