Skip to main content

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.

ParameterTypeDescriptionExample/Possible Values
PATH PARAMS
polyfence_idstringrequired
Polyfence identifier
LpwjgJyDQqreRkExXlEAGYmVlazNdOMX
QUERY PARAMS
behaviourstringGeofence behaviour - see belowIN_OUT, IN, OUT, IN_OFF
geofencestringGeofence identifierpwjgJyDQqreRknxbeGEAGYmVlazNdOMX

Geofence Behaviour

BehaviourDescription
IN_OUTTracker will transmit when it enters or leaves the Geofence
INTracker will only transmit when it enters the Geofence
OUTTracker will only transmit when it leaves the Geofence
IN_OFFTracker 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
}
}