_save

Creates or modifies a Geofence.

Parameters

data

An array of several aspects of the chosen Geofence: name max_lat min_lat max_lng min_lng points (radius, type) last_edited cdate

name

The name assigned to the created/saved Geofence

Example

This will set the name of a Geofence with the ID of 2 to 'Test', give it a radius of 250 in a circle shape, and center it around Forthill Park in Enniskillen

FM_api(
    'Geofence_save',[
        'data' => '{"id":2,"max_lat":54.347115,"min_lat":54.343517,
        "max_lng":-7.6295705,"min_lng":-7.635742,"points":{"radius":250,
        "type":"circle"},"name":"Test","meta":[],"last_edited":1679828787,
        "cdate":1679828658}'
    ]
);

Results

On Success

{"ok":1,"id":2}

On Failure

If there is no data variable requested or the requested variable is not formatted correctly:

{"error":"missing or invalid parameter: data"}

If a new name being given to the Geofence is higher than 50 characters

{"error":"name too long. max length 50"}

Last updated