Application Configuration & Notifications

Application configuration payloads based on configuration fields and notifications.

Andrei avatar
Scris de Andrei
Actualizat cu mai mult de o săptămână în urmă

During application registration you will be able to fill in the Application Configuration section.
Application Configuration serves as method that allows Ebriza's clients to interact with your application settings by modifying whatever fields you have defined.
Whenever an Ebriza client that has your application installed modifies and saves your application settings we will make a POST API call to your system at the URL that you provided during application registration. We will also use that POST URL to send you additional notifications described below.

Configuration

We will make the POST API call with a JSON with <Key, Value> pairs. Where the key is the configuration field name and the value is whatever the user submitted.

Boolean:

If the configuration field is of type boolean, the payload will have the following structure:
{ "booleanFieldName": true } or { "booleanFieldName": false }

Where booleanFieldName was the field name submitted during application registration for this particular field. This pattern applies for the examples below as well.

String:

If the configuration field is of type string, the payload will have the following structure:
{ "stringFieldName": "string that is not sanitized. Robert'); DROP TABLE Students;--" }

Date:

If the configuration field is of type date, the payload will have the following structure:
{ "dateFieldName": "2018-07-10T11:14:06Z" }
The date value follows the ISO 8601 format, adjusted for UTC time.

Single select custom options:

If the configuration field is of type single select with custom options, the payload will have the following structure:
{ "singleSelectFieldName": "optionID" }

Single select users options:

If the configuration field is of type single select with users as options, the payload will have the following structure:
{ "singleUsersSelectFieldName": "38A6B4FA-543F-499D-B45A-D65F2EDE351B" }

Where the value is the selected user ID.

Single select locations options:

If the configuration field is of type single select with locations as options, the payload will have the following structure:
{ "singleLocationsSelectFieldName": "258F483E-0DDF-49C0-86FD-8BA281AB6E00" }

Where the value is the selected location ID.

Single select rooms options:

If the configuration field is of type single select with rooms as options, the payload will have the following structure:
{ "singleRoomSelectFieldName": "D388B8A7-63DF-4861-9B93-09BD8E38EF9F" }

Where the value is the selected room ID.

Multi select with custom options:

If the configuration field is of type multi select with custom options, the payload will have the following structure:
{ "multiCustomSelectFieldName": ["optionID1", "optionID2"] }

The same pattern applies for other types of multi select.

Notifications

If you have provided us a POST URL in the application configuration section, we will send you notifications for the following scenarios:

  • Application install

  • Application configuration change

  • Application uninstall

The payload of the POST API call will be in the following format:

{
    "ActionType": ActionType int,
    "EbrizaClientID": Guid
    "LocationID": Guid
    "Configuration": Configuration POJO
}

Where ActionType has the following values:

  • 0 - Install happened

  • 1 - Uninstall happened

  • 2 - Configuration changed

EbrizaClientID represents the ebriza client identifier (the same one that you add in the header when you make API calls towards us). More information can be found here.
LocationID represents the identifier for the client's location from where the request has been started. More information can be found here.
Configuration is a plain old javascript object with <Key, Value> pairs that have been described in the section above.

POST API call with example payload:

The POST API call that we will make towards your system (when the user changes a configuration) has the following structure:

curl -X POST https://yourposturl.com
       -H 'Cache-Control: no-cache'
       -H 'Content-Type: application/json'
       -H 'ebriza-clientid: D9707F3B-3BC9-4D45-B03E-A1ECC38A9EE9'
       -d '{
                  "ActionType": 2,
                  "EbrizaClientID": "D9707F3B-3BC9-4D45-B03E-A1ECC38A9EE9",
                  "LocationID": "9E350D04-385E-4A41-AB8D-21C5FAA4183B",
                  "Configuration": {
                             "booleanFieldName": "true",
                             "stringFieldName": "string that is not sanitized.",
                             "dateFieldName": "01/01/2010 00:00:00",
                             "singleSelectFieldName": "optionID",
                            "singleUsersSelectFieldName": "02F35908-84B3-4534....",
                            "singleLocationsSelectFieldName": "B4EDB0A8-6D801....",
                            "singleRoomSelectFieldName": "02F35908-84B3-4534....",
                            "multiCustomSelectFieldName": ["optionID1", "optionID2"]
                  }
            }'

If the API call fails we will revert the configuration to the previously saved configuration.
If the API call succeeds we will save the new configuration as well.


Ați primit răspuns la întrebare?