Attaching Geofences to a Polyfence (POST)
https://core.rock7.com/API3/Polyfence/{polyfence_id}/Attach
This command will “attach” a geofence to the specified polyfence with the given behaviour; this command can be called repeatedly to attach more than one Geofence.
Parameter | Type | Description | Example/Possible Values |
---|---|---|---|
PATH PARAMS | |||
polyfence_id | string | required Polyfence identifier | LpwjgJyDQqreRkExXlEAGYmVlazNdOMX |
QUERY PARAMS | |||
behaviour | string | Geofence behaviour - see below | IN_OUT , IN , OUT , IN_OFF |
geofence | string | Geofence identifier | pwjgJyDQqreRknxbeGEAGYmVlazNdOMX |
Geofence Behaviour
Behaviour | Description |
---|---|
IN_OUT | Tracker will transmit when it enters or leaves the Geofence |
IN | Tracker will only transmit when it enters the Geofence |
OUT | Tracker will only transmit when it leaves the Geofence |
IN_OFF | Tracker will transmit when it enters the Geofence; and then disable Polyfence mode. |
Example with Parameters
curl --request POST \
--url 'https://core.rock7.com/API3/Polyfence/LpwjgJyDQqreRkExXlEAGYmVlazNdOMX/Attach?behaviour=IN&geofence=pwjgJyDQqreRknxbeGEAGYmVlazNdOMX&username=myUsername&password=myPassword' \
--header 'accept: application/json'
Response
{
"polyfence": {
"created": "2024-07-12T16:14:22.000Z",
"geofences": [
{
"geofence": {
"name": "bermuda_triangle",
"definition": "25.41,-80.23,32.38,-64.67,18.38,-65.63",
"id": "JYXyvGekqxMKABvYGyEzbRDgVQZOwmdp",
"type": "geofence"
},
"behaviour": "IN"
}
],
"name": "Polyfence XYZ",
"id": "OVdRorbmlwqkNBpaZynJYPZvxaXpzjLg",
"type": "polyfence",
"locked": false
}
}