Public API – POST Create Application

The applications endpoint allows a new app to be created. One or many location-based scenarios (comprised of Zones, Beacons, Geofences, Actions and Conditions) can then be created for each app.

URL to call

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

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).
name String Name given to the application.
packageName String Package name of the app. A package contains a reverse domain name that must be unique to this application.
NOTE: The package name has no relation to an app bundle identifier that is utilised to publish an app to the Google Play or Apple App store.
nextRuleUpdateIntervalFormatted String A mobile device will wait for the interval to lapse before subsequently downloading the rules from the server. A longer interval will help save your users battery. HH:MM
firebaseApiKey String The Web API key from Firebase project settings. Using this key our backend will be able to communicate with Firebase to deliver the zones that need to be synced to your application.
webhook Object In the webhooks object, a webhook can be registered to track events such as a check-in. Additional information and examples are provided below.

Example: JSON request to create an application

{
    "security": {
        "customerApiKey": "b6e99872-eb5b-4f1a-8147-b7b3205d0444"
    },
    "content": {
        "application": {
            "name": "University Campus Application",
            "packageName": "com.bluedotinnovation.campusapp",
            "nextRuleUpdateIntervalFormatted": "10:00"
        }
    }
}

Example: JSON request to create an application with webhook

To add a webhook while creating an application, include the webhook envelope as part of the create application JSON request. Webhooks can be set to receive real-time check-in information.

Name
Required
Data Type
Description
Format
url String The URL of the server where the webhooks will be received. We suggest that the service has SSL enabled.
enabled Boolean Marks the webhook as enabled. When an event such as a check-in is received on our backend then the check-in will be relayed to the webhook receiver if enableWebhook is set to “true”. true/false
securityTokenKey String To provide additional security, we prefer to send a key value pair as part of the request header. The securityTokenKey is the name of the field to be sent in the POST request header. Example: “authToken” or “apiKey”
secuityTokenValue String The securityTokenValue field carries the security token sent in the POST request header. Example: “f2f7a58c-f0d5-498c-9bad-acbc89923dc5” or “e4d2697bc8cc4df98ab6a88f0fd56ec3”
{
    "security": {
        "customerApiKey": "b6e99872-eb5b-4f1a-8147-b7b3205d0444"
    },
    "content": {
        "application": {
            "name": "University Campus Application",
            "packageName": "com.bluedotinnovation.campusapp",
            "nextRuleUpdateIntervalFormatted": "10:00",
            "webhook":{
                "url": "https://api.campusapp.com/webhook/checkinreceiver",
                "enabled": true,
                "securityTokenKey": "authToken",
                "securityTokenValue": "f2f7a58c-f0d5-498c-9bad-acbc89923dc5"
            }
        }
    }
}

Example: JSON request to create an application for zones sync enabled

{
    "security": {
        "customerApiKey": "b6e99872-eb5b-4f1a-8147-b7b3205d0444"
    },
    "content": {
        "application": {
            "name": "University Campus Application",
            "packageName": "com.bluedotinnovation.campusapp",
            "nextRuleUpdateIntervalFormatted": "10:00",
            "firebaseApiKey": "gDZyt1Bj_Y6S8BKyQfKH6uZ9wc475hrRlGA_6lS"
        }
    }
}

Example: JSON response to request

{
    "applicationId": "fa8a79fe-5304-4ce3-bdb4-a6daceb92b75",
    "apiKey": "a46fc46a-63ac-4c0c-8a9c-3c9aafd88e46",
    "packageName": "com.bluedotinnovation.campusapp",
    "name": "University Campus Application",
    "message": "Your request has been successfully processed.",
    "messageCode": 200
}

Source code examples

Created by Bluedot DevOps on January 17, 2018

Start the discussion