POST Create Lookup Zones with Conditions

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. This example demonstrates adding of Conditions while creating a Zones from the Places lookup results.

The conditions will be added to each of the actions that are being created in the request.

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

Information on the primary fields can be found here.

Conditions object JSON fields

Name Required Data Type Description Format
conditions Object The conditions object is where the different conditions can be added to an action. At least one of the following fields should be present: dateRange, timeActive or speed.
dateRange Array Start and end dates for the date range condition. Multiple date ranges can be added to a condition.
start String The start date from when the action should be triggered. To be used in the dateRange object. dd/mm/yyyy
end String The end date after when the action would not be triggered. To be used in the dateRange object. dd/mm/yyyy
timeActive Array Start and end time for the time active condition. Time must be in HH:MM format, using a 12-hour clock and reference to AM or PM. Example “09:00” with a period of “am”.
from Object The start time from when the action would be triggered. To be used in the timeActive object.
to Object The end time after when the action would not be triggered. To be used in the timeActive object.
time String Time must use a 12-hour clock. To be used in the timeActive object. HH:MM
period String The Time period of the day. To be used in the timeActive object. am/pm
speed Array Minimum and maximum speed for the Speed condition. The minimum difference between the minimum and maximum speed should be 5 m/s.
minimumSpeed Number The minimum speed from when the action would be triggered. To be used in the speed object. 0 – N
maximumSpeed Number The maximum speed from when the action would be triggered. To be used in the speed object. 0 – N

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

Zones request with Conditions

{
    "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
        },
        "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
            }]
        }
    }
}

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