Public API – POST Update Application

The applications end point allows an existing app to be amended.

URL to call

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

Content Type

The content type should be specified in the Content-Type field in the 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).
applicationId String The application identifier for the app. This is returned from application/get call. This is not the same as the apiKey retreived from Bluedot Point Access backend in the App and Beacon Management >> Manage Apps screen.
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 update an application

{
    "security": {
        "customerApiKey": "b6e99872-eb5b-4f1a-8147-b7b3205d0444"
    },
    "content": {
        "application": {
            "applicationId": "a46fc46a-63ac-4c0c-8a9c-3c9aafd88e46",
            "nextRuleUpdateIntervalFormatted": "10:00"
        }
    }
}

Example: JSON request to update an application as well as update the registered webhook

To add or edit an existing webhook while updating an application, include the webhook envelope as part of the create application JSON request.

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”  0
{
    "security": {
        "customerApiKey": "b6e99872-eb5b-4f1a-8147-b7b3205d0444"
    },
    "content": {
        "application": {
            "applicationId": "a46fc46a-63ac-4c0c-8a9c-3c9aafd88e46",
            "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 update an application to add or update the Firebase API key

{
    "security": {
        "customerApiKey": "b6e99872-eb5b-4f1a-8147-b7b3205d0444"
    },
    "content": {
        "application": {
            "applicationId": "a46fc46a-63ac-4c0c-8a9c-3c9aafd88e46",
            "nextRuleUpdateIntervalFormatted": "10:00",
            "firebaseApiKey": "gDZyt1Bj_Y6S8BKyQfKH6uZ9wc475hrRlGA_6lS"
        }
    }
}

Example: JSON response to request

{
    "applicationId": "fa8a79fe-5304-4ce3-bdb4-a6daceb92b75",
    "nextRuleUpdateIntervalFormatted": "10:00",
    "message": "Your request has been successfully processed.",
    "messageCode": 200
}

Source code examples

Created by Bluedot DevOps on March 3, 2018

Start the discussion