Different ways to create a Geofence at Roam

There are two ways you can create your personalized and customizable geofences with Roam.ai. It's either through our dashboard or directly through the API.

Dashboard

To create a geofence through our dashboard within your project is straightforward and intentionally intuitive. On the map in your project, you can go to the desired location, select the location point you want, and create the geofence in the shape you like. Alternatively, you can enter the address to look it up faster.

API

The second way you can create a geofence is through the Roam API directly. Specifically, the CREATE Geofence API. In the code of this API you can manually input the address, coordinates, geometry radius, the description of the location, the tag, and metadata freely yourself.

Here's a sample of how that would look:

curl --location --request POST 'https://api.roam.ai/v1/api/geofence/' \
--header 'Api-Key: e566c098cc6b441a9c3453b6fcf76e88' \
--header 'Content-Type: application/json' \
--data-raw '{
"coordinates": [ -72.28122, 42.926042 ] ,
"geometry_radius": 177,
"description": "Roam Amsterdam HQ",
"tag": "Office",
"metadata": {},
 "user_ids": ["6bda16edea01848b3b419163"],
 "group_ids": ["5cda16edea00845b3b419173"],
"is_enabled": [true, "2021-06-10T18:45:00", "2021-06-10T19:29:00"]
}'

You can consult our Geofencing docs page, which gives you the complete rundown on what geofencing is and how to build them with Roam. It includes sample code and visuals to guide you through every type of geofence you can possibly make with Roam.

Published on:
September 20, 2023
Updated on:
September 20, 2023