Home Forums Traccar API PHP Integration Geofence Create & Update Reply To: Geofence Create & Update

#203
James JosephJames
Keymaster

Hi,

Try the following

public static function geofenceCreate($sessionId,$name,$description,$area,$server){
	
	$id = '-1';
	$attributes = '{}';

	$data='{"id":"'.$id.'","name":"'.$name.'","description":"'.$description.'","area":"'.$area.'","attributes":'.$attributes.'}';

	return self::curl('/api/geofences','POST',$sessionId,$data,array(self::$jsonC),$server);
}