Enable or Disable Geofence

Last Updated on : 2023-06-19 07:07:01

Set the geofence status to be enabled or disabled.

API address

PUT: /v2.0/iot-01/fences/{fence_id}/open

Request parameter

Parameter name Type IN Required Description
fence_id Long uri true The geofence ID.

Description of body

Parameter name Type IN Required Description
enable Integer body true Indicates whether the geofence is enabled. Valid values:
  • 0: disabled.
  • 1: enabled.

Return parameter

Parameter name Type Description
result Boolean Indicates whether the operation is successful.

Request example

PUT: /v2.0/iot-01/fences/44008/open
{ "enable": 1 }

Return example

{ "result": true, "t": 1625225268916, "success": true }

Error code

For more information, see error code.