Last Updated on : 2023-06-20 14:52:23download
Create a polygonal geofence. The binding types include private geofences and public geofences. A private geofence is used to monitor a single object, and up to 100 private geofences can be created for an object. The total number of private geofences under an account is unlimited.
A public geofence can be used to monitor multiple objects, and up to 1,000 public geofences can be created for an account.
POST: /v2.0/iot-01/fences/polygon
Description of body
Parameter name | Type | IN | Required | Description |
---|---|---|---|---|
tag | String | false | The custom dimension tag to classify the geofences. The geofences can be filtered by the dimension tags. | |
fence_name | String | true | The name of the geofence. | |
bind_type | Integer | true | Indicates the binding type of the geofence. Valid values:
|
|
entity_id | String | false | The ID of a monitored object. The field is required when it is a private geofence, and the field is invalid for a public geofence. | |
vertexes | String | true | The coordinates of the vertices of the polygon, including the latitude and longitude. The number of vertices ranges from 3 to 50. | |
coord_type | String | true | Indicates the type of the longitude and latitude positioning coordinate system. Valid values:
|
|
warn_rule | Integer | true | Indicates the alert rules. Valid values:
|
Parameter name | Type | Description |
---|---|---|
result | FenceIdRes |
Description of result
Parameter name | Type | Description |
---|---|---|
fence_id | Long | The geofence ID. |
POST: v2.0/iot-01/fences/polygon
{
"tag": "ceshi",
"fence_name": "The Second Polygonal Geofence",
"entity_id": "vdevo16245017293****",
"bind_type": 1,
"vertexes": "30,120;31,121;29,120",
"coord_type": "WGS84",
"warn_rule": 1
}
{
"result": {
"fence_id": 51001
},
"t": 1625212527083,
"success": true
}
For more information, see error code.
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback