Widget - POST Add 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) |
{
"message": "dashboard created",
"data": {
"id": "814"
},
"code": 200
}
{
"message": "Invalid Message",
"code": 400,
"errors": [
{
"field": "widget_name",
"message": "The widget name field is required.."
}
]
}