POST Create Lookup Zones with Actions

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 message or URL action while creating a Zone from the Places lookup results.

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.

Actions object JSON fields

Name Required Data Type Description Format
actions Object The actions object is used to add the different action types (Message and URL).
name String An identifying name for the action.
messageActions Array The messageActions array is used to add one or more message actions to the Zone.
title String Title of the message received on the device.
message String Body of the message received on the device.
urlActions String The urlActions array is used to add one or more URL actions to the Zone.
url String URL that will be opened when the device enters a Zone.

Example: JSON request to create Zone from the lookup results

URL to call

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

Zone request with Actions

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

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