# Downlink form

Retrieves the downlink form configuration by Device EUI, Response contains all the required fields and various details to build a downlink form based on instructions. There are various type of fields available with Parent-Child relations.

Field types: Toggle, Select, Number, Text, Yes/No, Decimal

We suggest going through whole object to identify all the field options to build the form.

GET /devices/<deviceId>/configure/create

Example request

curl --location --request GET 'https://console.radiobridge.com/api/visualization/v1/devices/<deviceId>/configure/create' \
--header 'Organization: <organization id>' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <token>'

Example Response

{
    "last_config": false,
    "fields": [
        {
            "id": 76,
            "name": "Close hold time",
            "key": "close_hold_time",
            "values": [
                {
                    "value": "0",
                    "text": "0 Seconds"
                }               
            ],
            "description": null,
            "type": "select",
            "placeholder": "--Select--",
            "parent": null,
            "import_description": null
        }
    ],
    "general": [
        {
            "id": "dis",
            "type": "toggle",
            "name": "Disable all events",
            "key": "disableall",
            "description": "This will disable all events",
            "placeholder": "",
            "toggle_type": "normal",
            "child": [],
            "extra_config": []
        },
        {
            "id": "supervisory_period",
            "name": "Supervisory Period",
            "key": "supervisory_period",
            "values": [
                {
                    "text": "1 Minutes Interval",
                    "value": 129
                }
            ],
            "description": "Sends a report after every defined interval",
            "type": "select",
            "placeholder": "--Select--",
            "parent": null,
            "import_description": "In Hour/Minutes, Valid range for (Hours: 1 - 127) or (Minutes: 129 - 255)"
        },
        {
            "id": "sampling_period",
            "key": "sampling_period",
            "name": "Sampling Period",
            "type": "select_toggle",
            "values": [
                {
                    "value": "0",
                    "text": "Leave Unchanged"
                }
            ],
            "child": [
                {
                    "id": "",
                    "key": "sampling_rates",
                    "name": "",
                    "values": [
                        {
                            "text": "Leave Unchanged",
                            "value": 0
                        }
                    ],
                    "type": "select",
                    "placeholder": "--Select--",
                    "parent": null,
                    "show_when_parent_value": [
                        "seconds",
                        "minutes",
                        "hours"
                    ],
                    "description": "A value of 0 in this field leaves the sampling rate at the current value"
                },
                {
                    "id": "",
                    "key": "sampling_rates_ms",
                    "name": "",
                    "values": [
                        {
                            "text": "Leave Unchanged",
                            "value": 0
                        }
                    ],
                    "type": "select",
                    "placeholder": "--Select--",
                    "parent": null,
                    "show_when_parent_value": "milliseconds",
                    "description": "A value of 0 in this field leaves the sampling rate at the current value"
                }
            ]
        },
        {
            "id": "radioconfig",
            "key": "radioconfig",
            "name": "Enable Adaptive Data Rate",
            "description": "LoRaWAN only",
            "type": "toggle",
            "placeholder": "",
            "toggle_type": "normal",
            "child": [],
            "extra_config": []
        },
        {
            "id": "unconfirmed",
            "key": "unconfirmed",
            "name": "Use Confirmed Messages",
            "description": "LoRaWAN only",
            "placeholder": "",
            "type": "toggle",
            "toggle_type": "group_fields",
            "child": [
                {
                    "id": "uplink_retries",
                    "key": "uplink_retries",
                    "name": "Uplink Retries",
                    "values": [
                        {
                            "text": "Leave Unchanged",
                            "value": 0
                        }
                    ],
                    "description": "Sends a report after every defined interval",
                    "type": "select",
                    "placeholder": "--Select--",
                    "parent": null,
                    "show_when_parent_value": "1"
                }
            ]
        }
    ],
    "advanced": [
        {
            "id": "port_number",
            "key": "port_number",
            "name": "Port number",
            "description": "LoRaWan only ( Valid range: 1 - 223)",
            "type": "number",
            "placeholder": "Number only",
            "min": 1,
            "max": 223,
            "step": 1,
            "precision": 0,
            "parent": null
        },
        {
            "id": "rejoin_period",
            "key": "rejoin_period",
            "name": "Link Quality Check Period",
            "description": "LoRaWan only",
            "values": [
                {
                    "text": "1 Minutes Interval",
                    "value": 129
                }
                ],
            "type": "select",
            "placeholder": "--Select--",
            "parent": null,
            "import_description": "Define value in Hour/Minutes, Valid ranges are (Hours: 1 Hour - 127 Hour) or (Minutes: 129 - 255, where 129 = 1 Minute, 130 = 2 Minutes, 255 = 127 Minutes and so on) or Enter '0' to Disable"
        }
    ],
    "isLora": true
}

Response Body

Parameter Type Description
last_config object/bool Contains last saved configuration. It will hold false when there is no last saved configuration.
fields object Contains the Config fields object
general object Contains the General fields object
advanced object Contains the Advanced fields object
isLora boolean If the device network type is lorawan,it will hold true or otherwise false.

# Form fields object

Config, General and Advanced. All fields have the same attributes given below:

Parameter Type Description
name string Field name to be used as label for field
key string Field key is the actual field name to assign the value and pass to APIs
values array Holds field values in array format when type will be select, radio
description string Small Description about the field
type string Type attribute of field. e.g. select, text, number, radio, toggle
placeholder string Placeholder value for the field
toggle_type string Type of toggle when field type is toggle only. expected types: group_fields, normal
child array Contains child field attributes on the basis of selection and when it's not empty, then one more field will be created in the current field on the basis of selection. Child fields description
extra_config object Contains extra configuration. For eg. threshold value etc.

# Child fields object

Child fields contains few more attributes apart from the attributes from Form fields objects:

Parameter Type Description
parent integer Parent field id
show_when_parent_value any By default child fields will be hidden, this value indicates when we need to show this child group when its parent value is equal to the configured value