Data routers

Data routers are used to forward data to internet-connected systems such as your backend services, monitoring and dashboards.

Message formats

The default payloads for webhooks, websockets and MQTT outputs are a JSON structure with the payload and relevant metadata unless configured otherwise. Some of the substructures will be omitted if there’s no relevant data:

{
    "messageId" "{message ID}",
    "type": "[keepalive|data]",
    "device": {
        "deviceId": "string",
        "collectionId": "string",
        "tags": { },
        "firmware": {
            "currentFirmwareId": "string",
            "targetFirmwareId": "string",
            "firmwareVersion": "string",
            "serialNumber": "string",
            "modelNumber": "string",
            "manufacturer": "string",
            "state": "string",
            "stateMessage": "string"
        },
        "config": {
            "ciot": {
                "imsi": "",
                "imei": ""
            },
            "inet": { },
            "gateway": { },
        },
        "metadata": {
            "ciot": {
                "gatewayId": "string",
                "allocatedIp": "string",
                "allocatedAt": "",
                "cellId": "",
                "mcc": 0,
                "mnc": 0,
                "country": "string",
                "network": "string",
                "countryCode": "string",
                "lastUpdate": "",
                "lastImsi": "",
                "lastImei": ""
            },
            "inet": {
                "gatewayId": "string",
                "lastUpdate": "",
                "remoteAddress": "string",
                "certificateSerial": ""
            },
            "gateway": {
                "gatewayId": "string",
                "lastUpdate": "",
                "params": { },
            }
        },
        "lastGatewayId": "string",
        "lastTransport": "unspecified",
        "lastReceived": "",
        "lastPayload": ""
    },
    "payload": "{payload string, base64 encoded}",
    "received": "{time stamp for message}",
    "transport": "{udp|coap|mqtt}",
    "udpMetaData": {
        "localPort": {port number},
        "remotePort": {port number}
    },
    "coapMetaData": {
        "code": "{POST|GET}",
        "path", "{path to resource}"
    },
    "mqttMetaData": {
        "topic": "{mqtt topic}"
    },
    "gatewayMetaData": {
        "{name}": "{value}"
    },
    "gatewayId": "{ID of receiving gateway}"
}