POST Create Lookup Zones

The Zones endpoint within lookup allows you to create Zones from the lookup results. The Zones created will have a circular or rectangular Geofence and a Custom Action created by default. You can also add different types of ActionsConditions, and Custom Data fields to the Zone as well.

URL to call

https://api.bluedotinnovation.com/1/poi/lookup/{lookupId}/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
lookupId String The lookupId returned when the lookup request was made.
customerApiKey String API key for the customer found in the Account Management tab of Point Access UI.
apiKey String API Key of the relevant app found in the Manage Apps section of the App and Beacon Management tab of Point Access UI.
place_ids Array Place IDs uniquely identify a place in the Google Places database and on Google Maps.
fence Object The fence object is where the circular fence related information can be added to the Zone.
checkout Boolean If the checkout flag is set to true, then it marks the Zone as a check-out Zone. When a device leaves a fence, a custom action will be triggered. In a check-out Zone, Minimum Retrigger Time applies only after a device checks out of a fence or beacon.

If the checkout flag is set to false, the Zone will be marked as check-in Zone.

true/false
zoneName String The name you would like to provide for the Zone being created. You can add the first level information from the places results like the vicinity, name or fields from the lookup request like search_type or search_keyword. More information can be found here.
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

Fence Object fields

Name Required Data Type Description Format
type String The type of the Geofence being created. circle / rectangle
name String The name of the Geofence being created. You can add the first level information from the places results like the vicinity, name or fields from the lookup request like search_type or search_keyword. More information can be found here.
radius Number Double value representing the radius of a circular geofence in meters. This field is required if the type is ‘circle’.
diagonal Number Double value representing the diagonal length of a rectangular geofence in meters. Based on the location of the returned in the lookup for the place and the diagonal provided the northeast and southwest latitude and longitude of the rectangular geofence is calculated. This field is required if the type is ‘rectangle’.

Optional fields that can be added in the request

Parameters in the fence and zoneName fields

Parameter Description
name It contains the human-readable name for the returned result.
place_id It a textual identifier that uniquely identifies a place.
rating It contains the place’s rating, from 1.0 to 5.0, based on aggregated user reviews.
search_keyword The search keyword provided in the Create Lookup request.
search_type The search type provided in the Create Lookup request.
vicinity It contains a feature name of a nearby location. Often this feature refers to a street or neighborhood within the given results.

Example: JSON request to create Zones from the lookup results

URL to call

https://api.bluedotinnovation.com/1/poi/lookup/dbf9f6b0-3668-407e-87b5-ee5aba4e35a0/zones

Zone request with a circular Geofence

{
    "security": {
        "customerApiKey": "d851c260-9a31-11e5-b7e5-b8ca3a6b879d",
        "apiKey": "7e9a7d30-1f09-11e7-ad24-06a56cd124c5"
    },
    "content": {
        "place_ids": ["ChIJj0s0A81_j4ARbMK9LbiEB9M", "ChIJ7zxvyAR-j4AR_ueCaXrCefk", "ChIJ10DmyyR-j4ARBZDBrVVevpo"],
        "zoneName": "{name} ({search_type} - {search_keyword})",
        "checkout": true,
        "minimumRetriggerTime": "20:00",
        "fence": {
            "type": "circle",
            "name": "20m Circle around {vicinity}",
            "radius": 20
        }
    }
}

Zone request with a rectangular Geofence

{
    "security": {
        "customerApiKey": "d851c260-9a31-11e5-b7e5-b8ca3a6b879d",
        "apiKey": "7e9a7d30-1f09-11e7-ad24-06a56cd124c5"
    },
    "content": {
        "place_ids": ["ChIJj0s0A81_j4ARbMK9LbiEB9M", "ChIJ7zxvyAR-j4AR_ueCaXrCefk", "ChIJ10DmyyR-j4ARBZDBrVVevpo"],
        "zoneName": "{name} ({search_type} - {search_keyword})",
        "checkout": true,
        "minimumRetriggerTime": "10:00",
        "fence": {
            "type": "rectangle",
            "name": "60m Rectangule around {vicinity}",
            "diagonal": 60
        }
    }
}

Complete Zone request

More information on the  ActionsConditions, and Custom Data fields can be found in the hyperlinks.

{
    "security": {
        "customerApiKey": "d851c260-9a31-11e5-b7e5-b8ca3a6b879d",
        "apiKey": "7e9a7d30-1f09-11e7-ad24-06a56cd124c5"
    },
    "content": {
        "place_ids": ["ChIJj0s0A81_j4ARbMK9LbiEB9M", "ChIJ7zxvyAR-j4AR_ueCaXrCefk", "ChIJ10DmyyR-j4ARBZDBrVVevpo"],
        "zoneName": "{name} ({search_type} - {search_keyword})",
        "checkout": true,
        "minimumRetriggerTime": "20:00",
        "fence": {
            "type": "circle",
            "name": "20m Circle around {vicinity}",
            "radius": 20
        },
        "actions": {
            "urlActions": [{
                "name": "Bluedot Webiste",
                "url": "http://www.bluedotinnovation.com"
            }],
            "messageActions": [{
                "name": "Hello_World",
                "title": "Hello",
                "message": "Hello World!!!"
            }]
        },
        "conditions": {
            "dateRange": [{
                "start": "01/10/2016",
                "end": "01/12/2017"
            }],
            "timeActive": [{
                "from": {
                    "time": "10:00",
                    "period": "am"
                },
                "to": {
                    "time": "02:00",
                    "period": "pm"
                }
            }],
            "speed": [{
                "minimumSpeed": 10,
                "maximumSpeed": 30
            }]
        },
        "customFields": [{
            "key": "place_id",
            "value": "{place_id}"
        }, {
            "key": "vicinity",
            "value": "{vicinity}"
        }, {
            "key": "types",
            "value": "{types}"
        }, {
            "key": "rating",
            "value": "{rating}"
        }]
    }
}

Example: JSON response to request

{
    "zonesCreated": [
        "16d8ac8d-93be-4c79-b7c9-2fc1e1e87931",
        "04c98fe8-4b2f-4cb1-a535-d01da52b0be1",
        "ad6f3d7e-61ff-4850-8825-b6be3c4d5132"
    ],
    "message": "Your request has been successfully processed.",
    "messageCode": 200
}
Created by Bluedot DevOps on January 31, 2018

Start the discussion