Public API – GET Zones

The GET Zones endpoint returns a list of Zones created under an application including:

  • Zone details
  • actions
  • conditions
  • fences
  • beacons
  • sequence

URL to call

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

Parameters

Name
Required
Data Type
Description
Format
customerApiKey String API key for customer (rather than the app).
apiKey String API key for the app.
zoneId String The identifier of the Zone being retrieved
pageNumber Number A specific page number for a paginated result set; each page has 100 results.  0 – N

GET Zones for an Application

Specify the Customer API Key and application API Key to get all Zones created under a particular application.

https://api.bluedotinnovation.com/1/zones?customerApiKey=bc199c80-5441-11e4-b7bb-a0481cdc3311&apiKey=d3161e80-38d1-11e4-b039-bc305bf60831&pageNumber=0 

Example: JSON response to request

[
    {
        "zoneName": "Cafe Route 1",
        "zoneId": "77f35773-db23-45a6-a315-33d081c2967c",
        "minimumRetriggerTime": "01:00",
        "timeActive": {
            "from": {
                "time": "7:00",
                "period": "am"
            },
            "to": {
                "time": "4:00",
                "period": "pm"
            }
        },
        "actions": {
            "messageActions": [
                {
                    "title": "Hello",
                    "message": "Hello World!!!",
                    "name": "A_Message_Action",
                    "actionId": "1cbd5cb8-02dc-403f-b3d4-639104ba7f70",
                    "conditions": {
                        "percentageCrossed": [
                            {
                                "conditionId": "0a3d4fef-9a20-4853-a0a1-12c8312db601",
                                "percentage": 100,
                                "timeoutPeriod": "00:10",
                                "sequential": false
                            }
                        ]
                    }
                }
            ]
        },
        "fences": {
            "circles": [
                {
                    "name": "Jolimont St - Circle",
                    "color": "#50bd75",
                    "radius": 21.855626463826294,
                    "center": {
                        "latitude": -37.818367847655054,
                        "longitude": 144.97983187437057
                    },
                    "fenceId": "611f399b-b00c-45dd-97a3-651912b6410c"
                }
            ],
            "rectangles": [
                {
                    "name": "Wellington Parade - BoundingBox",
                    "color": "#a807f2",
                    "northEast": {
                        "latitude": -37.81641425706523,
                        "longitude": 144.9803602695465
                    },
                    "southWest": {
                        "latitude": -37.816763873062335,
                        "longitude": 144.97994720935822
                    },
                    "fenceId": "2bacd06e-3409-4c54-b34b-6c87e59f2eb6"
                }
            ]
        },
        "enableCheckOut": true,
        "activeAllDay": false,
        "sequence": [
            "611f399b-b00c-45dd-97a3-651912b6410c",
            "2bacd06e-3409-4c54-b34b-6c87e59f2eb6"
        ]
    },
    {
        "zoneName": "Cafe Route 2",
        "zoneId": "75b94389-1f7d-40a0-9dcd-889e536018cc",
        "minimumRetriggerTime": "01:00",
        "actions": {
            "customActions": [
                {
                    "name": "A_Custom_Action",
                    "actionId": "01537999-1bae-439e-b15c-babb341fd649",
                    "conditions": {
                        "dateRange": [
                            {
                                "conditionId": "becf0431-0c12-41b3-8620-bc74ccd2d58c",
                                "start": "12/05/2016",
                                "end": "26/05/2016"
                            }
                        ]
                    }
                }
            ],
            "urlActions": [
                {
                    "url": "http://www.bluedotinnovation.com",
                    "name": "A_URL_Action",
                    "actionId": "c57dccd0-42ec-4850-8909-19a171caac36",
                    "conditions": {
                        "timeActive": [
                            {
                                "conditionId": "3f385cf1-13d3-4cbb-baf3-5deea8aa2b29",
                                "from": {
                                    "time": "10:00",
                                    "period": "am"
                                },
                                "to": {
                                    "time": "1:00",
                                    "period": "pm"
                                }
                            }
                        ]
                    }
                }
            ]
        },
        "fences": {
            "polygons": [
                {
                    "name": "Agnes St",
                    "color": "#987b14",
                    "vertices": [
                        {
                            "latitude": -37.81666216676124,
                            "longitude": 144.97996866703033
                        },
                        {
                            "latitude": -37.81680201288913,
                            "longitude": 144.98032808303833
                        },
                        {
                            "latitude": -37.816399424834806,
                            "longitude": 144.98033344745636
                        },
                        {
                            "latitude": -37.81644180262813,
                            "longitude": 144.98004376888275
                        },
                        {
                            "latitude": -37.81666216676124,
                            "longitude": 144.97996866703033
                        }
                    ],
                    "fenceId": "266a67d7-3da7-4e74-ac71-f770b0cb0037"
                }
            ],
            "polylines": [
                {
                    "name": "Maxwell Ln",
                    "color": "#2B4F81",
                    "vertices": [
                        {
                            "latitude": -37.816713019929296,
                            "longitude": 144.97916400432587
                        },
                        {
                            "latitude": -37.81697576073959,
                            "longitude": 144.97915863990784
                        }
                    ],
                    "fenceId": "f2052a3e-8604-4498-81de-aa1586bf6c02"
                }
            ]
        },
        "enableCheckOut": false,
        "activeAllDay": true,
        "sequence": [
            "266a67d7-3da7-4e74-ac71-f770b0cb0037",
            "f2052a3e-8604-4498-81de-aa1586bf6c02"
        ]
    },
    {
        "zoneName": "Cafe",
        "zoneId": "b777018c-7be5-40f5-afa5-01528c97e00e",
        "minimumRetriggerTime": "02:00",
        "actions": {
            "customActions": [
                {
                    "name": "A_Custom_Action",
                    "actionId": "98c8bfec-af57-4b1b-9ea8-43b6965dd8f9",
                    "customFields": [
                        {
                            "key": "type",
                            "value": "Coffee Shop"
                        },
                        {
                            "key": "name",
                            "value": "Blue Bottle Coffee"
                        },
                        {
                            "key": "id",
                            "value": "48707775-4991-434b-ba3a-f41ac1236c44"
                        }
                    ]
                }
            ]
        },
        "beacons": [
            {
                "beaconId": "09c4e013-978b-4427-a925-18139e535608",
                "proximity": 2
            }
        ],
        "enableCheckOut": true,
        "activeAllDay": true,
        "sequence": [
            "09c4e013-978b-4427-a925-18139e535608"
        ]
    }
]

Get Zone By Zone ID

Specify the Customer API Key, application API Key and Zone ID to get Zone details of a particular Zone.

https://api.bluedotinnovation.com/1/zones?customerApiKey=fab77cd0-c094-11e5-a1fa-06a56cd124c5&apiKey=4116edf0-c095-11e5-a1fa-06a56cd124c5&zoneId=77f35773-db23-45a6-a315-33d081c2967c

Example: JSON response to request

 

{
    "zoneName": "Cafe Route 1",
    "zoneId": "77f35773-db23-45a6-a315-33d081c2967c",
    "minimumRetriggerTime": "01:00",
    "timeActive": {
        "from": {
            "time": "7:00",
            "period": "am"
        },
        "to": {
            "time": "4:00",
            "period": "pm"
        }
    },
    "actions": {
        "messageActions": [
            {
                "title": "Hello",
                "message": "Hello World!!!",
                "name": "A_Message_Action",
                "actionId": "1cbd5cb8-02dc-403f-b3d4-639104ba7f70",
                "conditions": {
                    "percentageCrossed": [
                        {
                            "conditionId": "0a3d4fef-9a20-4853-a0a1-12c8312db601",
                            "percentage": 100,
                            "timeoutPeriod": "00:10"
                        }
                    ]
                }
            }
        ]
    },
    "fences": {
        "circles": [
            {
                "name": "Jolimont St - Circle",
                "color": "#50bd75",
                "radius": 21.855626463826294,
                "center": {
                    "latitude": -37.818367847655054,
                    "longitude": 144.97983187437057
                },
                "fenceId": "611f399b-b00c-45dd-97a3-651912b6410c"
            }
        ],
        "rectangles": [
            {
                "name": "Wellington Parade - BoundingBox",
                "color": "#a807f2",
                "northEast": {
                    "latitude": -37.81641425706523,
                    "longitude": 144.9803602695465
                },
                "southWest": {
                    "latitude": -37.816763873062335,
                    "longitude": 144.97994720935822
                },
                "fenceId": "2bacd06e-3409-4c54-b34b-6c87e59f2eb6"
            }
        ]
    },
    "enableCheckOut": true,
    "activeAllDay": false,
    "sequence": [
        "611f399b-b00c-45dd-97a3-651912b6410c",
        "2bacd06e-3409-4c54-b34b-6c87e59f2eb6"
    ]
}

Source code examples

Created by Bluedot DevOps on March 3, 2018

Start the discussion