Public API – POST Message Action

The actions endpoint allows new message actions to be created and added to an existing Zone.

Message actions can be added regardless of whether the Zone was created using the Public API or via the web interface of the Bluedot back-end system, Point Access. One or more conditions can be attached to an action as shown in the example below. Conditions can be added at a later stage through the update action.

URL to call

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

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
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 updated.
actions Object The actions object is used to add the different action types (Message, URL and Custom).
messageActions Array The messageActions array is used to add one or more message actions to the zone.
name String An identifying name for the message action.
title String Title of the message received on the device.
message String Body of the message received on the device.

Example: JSON request to create a message action

{
    "security": {
        "customerApiKey": "bc199c80-5441-11e4-b7bb-a0481cdc3311",
        "apiKey": "d3161e80-38d1-11e4-b039-bc305bf60831"
    },
    "content": {
        "zone": {
            "zoneId": "24d9a245-2087-421b-9972-2af2ee0970f1",
            "actions": {
                "messageActions": [
                    {
                        "name": "A Message Action",
                        "title": "Welcome to Bluedot Innovation",
                        "message": "Welcome to Bluedot Innovation Offices"
                    }
                ]
            }
        }
    }
}

Example: JSON request to create a message action with conditions

{
    "security": {
        "customerApiKey": "bc199c80-5441-11e4-b7bb-a0481cdc3311",
        "apiKey": "d3161e80-38d1-11e4-b039-bc305bf60831"
    },
    "content": {
        "zone": {
            "zoneId": "a6375661-07e5-4596-800e-eef37d3cd6a6",
            "actions": {
                "messageActions": [
                    {
                        "name": "A Message Action",
                        "title": "Welcome to Bluedot Innovation",
                        "message": "Welcome to Bluedot Innovation Offices",
                        "conditions": {
                            "percentageCrossed": [
                                {
                                    "percentage": 50,
                                    "timeoutPeriod": "00:01",
                                    "sequential": false
                                }
                            ],
                            "dateRange": [
                                {
                                    "start": "12/12/2014",
                                    "end": "14/12/2015"
                                }
                            ],
                            "timeActive": [
                                {
                                    "from": {
                                        "time": "10:00",
                                        "period": "am"
                                    },
                                    "to": {
                                        "time": "2:00",
                                        "period": "pm"
                                    }
                                }
                            ],
                            "bearing": [
                                {
                                    "fromAngle": 80,
                                    "toAngle": 200
                                }
                            ],
                            "speed": [
                                {
                                    "minimumSpeed": 10,
                                    "maximumSpeed": 30
                                }
                            ]
                        }
                    }
                ]
            }
        }
    }
}

Example: JSON response to request

{
    "objectsUpdated": [
        {
            "actionId": "50bdaf4a-9262-45c2-b054-2cb78fa89e57",
            "actionName": "Welcome to Bluedot Innovation"
        }
    ],
    "message": "Your request has been successfully processed.",
    "messageCode": 200
}

Source code examples

Created by Bluedot DevOps on January 31, 2018

Start the discussion