Widget - PUT Update Map Widget
Post
{{url_iot_backend}}/ext/dashboards/:dashboardId/widgets
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Authorization",
"value": "Bearer {{token}}"
},
Parameter
Field | Type | Description |
---|---|---|
widget_name | String |
Name of the widget |
description | String |
Description of the widget |
width | Integer |
Width in grid units (2–12). Corresponds to % layout width. |
height | Integer |
Height in px. Min: 150, Max: 600 |
widget_type | String |
Must be "map" for this case |
map[x_size] | Float |
Width of the map in pixels |
map[y_size] | Float |
Height of the map in pixels |
map[map_background] | file(image) |
Background image for the map |
map[layers][i][name] | String |
Name of the layer |
map[layers][i][object_type] | String |
"circle" / "rectangle" / "polygon" etc. |
map[layers][i][marker_device_type] | String |
"telemetry" or others |
map[layers][i][value_type] | String |
"device" or other values |
map[layers][i][device] | Integer |
Device ID (optional) |
map[layers][i][location] | String |
Custom location value (optional) |
map[layers][i][device_telemetry_key] | String or Array of Strings |
Telemetry key(s) (optional) |
map[layers][i][location_custom_field] | String |
Optional custom field |
map[layers][i[with_automation] | Boolean (true/false) |
Enable automation logic |
map[layers][i][marker_telemetry_key] | String |
Telemetry key used for marker tracking |
map[layers][i][device_actuator_id] | Integer or Array of Integers |
Actuator ID(s) (optional) |
map[layers][i][is_show_telemetry_key] | Boolean |
Show telemetry values on map marker |
map[layers][i][layer_setting][index] | Integer |
Index of the circle layer (optional) |
map[layers][i][layer_setting][latlng][lat] | Float |
Latitude of circle center |
map[layers][i][layer_setting][latlng][lng] | Float |
Longitude of circle center |
map[layers][i][layer_setting][radius] | Float |
Radius of the circle in pixels or meters |
map[layers][i][layer_setting][default_color] | String |
Default color for the circle (hex code). |
map[layers][i][layer_setting][ack_color] | String |
Acknowledged alert color |
map[layers][i][layer_setting][alert_color] | String |
Alert color when condition is met |
map[layers][i][layer_setting][latlng][j][k][lat] | Float |
Latitude of corner point |
map[layers][i][layer_setting][latlng][j][k][lng | Float |
Longitude of corner point |
map[layers][i][layer_setting][default_color] | String |
Default fill color of shape |
map[layers][i][layer_setting][ack_color] | String |
Acknowledged alert color |
map[layers][i][layer_setting][alert_color] | String |
Alert fill color |
map[layers][i][layer_setting][alert_style][threshold_alert] | String |
Alert condition operator |
map[layers][i][layer_setting][alert_style][normal][color] | String |
Color for normal state |
map[layers][i][layer_setting][alert_style][warning][color] | String |
Warning color |
map[layers][i][layer_setting][alert_style][warning][threshold_value] | Integer |
Value that triggers warning state |
map[layers][i][layer_setting][alert_style][alert][color] | String |
Alert color |
map[layers][i][layer_setting][alert_style][alert][threshold_value] | Integer |
Threshold value that triggers alert state |
map[layers][i][layer_setting][alert_style][first_state][opacity | Integer |
Opacity for first state (0–100). |
map[layers][i][layer_setting][alert_style][second_state][opacity] | Integer |
Opacity for second state (0–100) |
[
{
"key": "widget_name",
"value": "test widget map",
"description": "required",
"type": "text"
},
{
"key": "description",
"value": "",
"type": "text"
},
{
"key": "width",
"value": "6",
"type": "text"
},
{
"key": "height",
"value": "300",
"type": "text"
},
{
"key": "widget_type",
"value": "map",
"type": "text"
},
{
"key": "map[x_size]",
"value": "833.3333333333334",
"type": "text"
},
{
"key": "map[y_size]",
"value": "500",
"type": "text"
},
{
"key": "map[layers][0][name]",
"value": "new rectangle 1",
"type": "text"
},
{
"key": "map[layers][0][object_type]",
"value": "rectangle",
"type": "text"
},
{
"key": "map[layers][0][marker_device_type]",
"value": "telemetry",
"type": "text"
},
{
"key": "map[layers][0][value_type]",
"value": "device",
"type": "text"
},
{
"key": "map[layers][0][device]",
"value": "655",
"type": "text"
},
{
"key": "map[layers][0][location]",
"value": "",
"type": "text"
},
{
"key": "map[layers][0][device_telemetry_key]",
"value": "",
"type": "text"
},
{
"key": "map[layers][0][location_custom_field]",
"value": "",
"type": "text"
},
{
"key": "map[layers][0][with_automation]",
"value": "false",
"type": "text"
},
{
"key": "map[layers][0][marker_telemetry_key]",
"value": "",
"type": "text"
},
{
"key": "map[layers][0][is_show_telemetry_key]",
"value": "0",
"type": "text"
},
{
"key": "map[layers][0][device_actuator_id]",
"value": "",
"type": "text"
},
{
"key": "map[layers][0][layer_setting][index]",
"value": "1",
"type": "text"
},
{
"key": "map[layers][0][layer_setting][latlng][0][0][lat]",
"value": "-115.2708511352539",
"type": "text"
},
{
"key": "map[layers][0][layer_setting][latlng][0][0][lng]",
"value": "-205.05717185624906",
"type": "text"
},
{
"key": "map[layers][0][layer_setting][latlng][0][1][lat]",
"value": "-25.270851135253906",
"type": "text"
},
{
"key": "map[layers][0][layer_setting][latlng][0][1][lng]",
"value": "-205.05717185624906",
"type": "text"
},
{
"key": "map[layers][0][layer_setting][latlng][0][2][lat]",
"value": "-25.270851135253906",
"type": "text"
},
{
"key": "map[layers][0][layer_setting][latlng][0][2][lng]",
"value": "-76.35435134300656",
"type": "text"
},
{
"key": "map[layers][0][layer_setting][latlng][0][3][lat]",
"value": "-115.2708511352539",
"type": "text"
},
{
"key": "map[layers][0][layer_setting][latlng][0][3][lng]",
"value": "-76.35435134300656",
"type": "text"
},
{
"key": "map[layers][0][layer_setting][default_color]",
"value": "#0F3A6D",
"type": "text"
},
{
"key": "map[layers][0][layer_setting][ack_color]",
"value": "#FFAF50",
"type": "text"
},
{
"key": "map[layers][0][layer_setting][alert_color]",
"value": "#EF3F3F",
"type": "text"
},
{
"key": "map[layers][0][id]",
"value": "1066",
"type": "text"
},
{
"key": "map[id]",
"value": "269",
"type": "text"
},
{
"key": "map[map_background]",
"type": "file",
"src": "/C:/Users/User-Name/Downloads/omah.jpg"
}
]
{
"message": "dashboard updated",
"data": {
"id": "1067"
},
"code": 200
}
{
"message": "Invalid Message",
"code": 400,
"errors": [
{
"field": "widget_name",
"message": "The widget name field is required.."
}
]
}