Home Forums Traccar API PHP Integration Geofence Create & Update

Tagged: , ,

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #197
    hex ohhex oh
    Participant

    Hi,

    Amazing work, Is there a working example of how we can use the Traccar API PHP Integrations geofence create and update options?

    • This topic was modified 5 months, 3 weeks ago by hex ohhex oh.
    #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);
    }
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.