SDK Reference
Geofences Area and area-group lifecycle methods, including create, update, archive, restore, and delete.
Note
Linxio calls geofences areas in the REST API.
This SDK uses linxio.geofences to make that domain clearer.
Important
If your tenant has many complicated geofences, or many geofence areas, the API can return extremely large response payloads. Consider whether using geofences.list() in production implementations is appropriate for your use case.
Input Object parameter. Expand to see child parameters.
Show child parameters Number of geofences to request.
Page number to request.
Default: 1
Sort expression accepted by Linxio.
Optional field projection.
Returns Geofence records for the requested page.
Show child fields colorstring | null
optional Polygon/polyline/rectangle coordinates.
radiusnumber | null
optional Circle radius when the geofence is circular.
Geofence shape type.
Possible enum values
polylinePolyline geofence.
rectangleRectangular geofence.
Pagination metadata.
Show child fields Total matching record count.
Typed SDK error when the page fails.
Show child fields Original cause when available.
HTTP method when the error came from a request.
API path when the error came from a request.
Request identifier from X-Request-Id when supplied.
const areas = await linxio.geofences. list ({
limit: 100 ,
page: 1 ,
});
if (areas.error) {
throw areas.error;
} {
"data" : [
{
"color" : "string" ,
"coordinates" : [
{
"lat" : -31.9523 ,
"lng" : 115.8613
}
] ,
"id" : 64553 ,
"name" : "Example" ,
"radius" : 123 ,
"type" : "Truck"
}
] ,
"meta" : {
"limit" : 100 ,
"page" : 1 ,
"total" : 2
} ,
"error" : null
}
Important
If your tenant has many complicated geofences, or many geofence areas, the API can return extremely large response payloads. Avoid using geofences.iterate() in production implementations.
Input Same parameters as geofences.list().
Show child parameters Optional geofence field projection accepted by Linxio.
Maximum records to request per page.
Page number to request.
Default: 1
Sort expression accepted by Linxio for that endpoint.
[filter]QueryValue
optional Additional endpoint-specific filters forwarded as query parameters.
Returns Flat array containing every loaded geofence.
Show child fields colorstring | null
optional Polygon/polyline/rectangle coordinates.
radiusnumber | null
optional Circle radius when the geofence is circular.
Geofence shape type.
Possible enum values
polylinePolyline geofence.
rectangleRectangular geofence.
Typed SDK error if any page fails.
Show child fields Original cause when available.
HTTP method when the error came from a request.
API path when the error came from a request.
Request identifier from X-Request-Id when supplied.
const { data : geofences , error } = await linxio.geofences. iterate ({
limit: 100 ,
});
if (error) {
throw error;
} {
"data" : [
{
"color" : "string" ,
"coordinates" : [
{
"lat" : -31.9523 ,
"lng" : 115.8613
}
] ,
"id" : 64553 ,
"name" : "Example" ,
"radius" : 123 ,
"type" : "Truck"
}
] ,
"error" : null
}
Input Same parameters as geofences.list().
Show child parameters Optional geofence field projection accepted by Linxio.
Maximum records to request per page.
Page number to request.
Default: 1
Sort expression accepted by Linxio for that endpoint.
[filter]QueryValue
optional Additional endpoint-specific filters forwarded as query parameters.
Returns One geofence at a time.
Show child fields colorstring | null
optional Polygon/polyline/rectangle coordinates.
radiusnumber | null
optional Circle radius when the geofence is circular.
Geofence shape type.
Possible enum values
polylinePolyline geofence.
rectangleRectangular geofence.
Thrown if a page request fails.
Show child fields Original cause when available.
HTTP method when the error came from a request.
API path when the error came from a request.
Request identifier from X-Request-Id when supplied.
for await ( const geofence of linxio.geofences. stream ({ limit: 100 })) {
console. log (geofence.id, geofence.name);
} {
"yield" : {
"color" : "string" ,
"coordinates" : [
{
"lat" : -31.9523 ,
"lng" : 115.8613
}
] ,
"id" : 64553 ,
"name" : "Example" ,
"radius" : 123 ,
"type" : "Truck"
}
}
Input Geofence area identifier.
Returns Geofence record.
Show child fields colorstring | null
optional Polygon/polyline/rectangle coordinates.
radiusnumber | null
optional Circle radius when the geofence is circular.
Geofence shape type.
Possible enum values
polylinePolyline geofence.
rectangleRectangular geofence.
Typed SDK error when the geofence cannot be loaded.
Show child fields Original cause when available.
HTTP method when the error came from a request.
API path when the error came from a request.
Request identifier from X-Request-Id when supplied.
const geofence = await linxio.geofences. get (areaId);
if (geofence.error) {
throw geofence.error;
} {
"data" : {
"color" : "string" ,
"coordinates" : [
{
"lat" : -31.9523 ,
"lng" : 115.8613
}
] ,
"id" : 64553 ,
"name" : "Example" ,
"radius" : 123 ,
"type" : "Truck"
} ,
"error" : null
}
Input Object parameter. Expand to see child parameters.
Show child parameters Geometry type.
Possible enum values
polylinePolyline geofence.
rectangleRectangular geofence.
Geometry coordinates. Circles typically use one centre point.
Radius in metres for circle geofences.
Display colour accepted by Linxio.
Returns Created geofence.
Show child fields colorstring | null
optional Polygon/polyline/rectangle coordinates.
radiusnumber | null
optional Circle radius when the geofence is circular.
Geofence shape type.
Possible enum values
polylinePolyline geofence.
rectangleRectangular geofence.
Typed SDK error when creation fails.
Show child fields Original cause when available.
HTTP method when the error came from a request.
API path when the error came from a request.
Request identifier from X-Request-Id when supplied.
const created = await linxio.geofences. create ({
name: "Temporary SDK Test Area" ,
type: "circle" ,
radius: 150 ,
coordinates: [{ lat: - 31.9505 , lng: 115.8605 }],
});
if (created.error) {
throw created.error;
} {
"data" : {
"color" : "string" ,
"coordinates" : [
{
"lat" : -31.9523 ,
"lng" : 115.8613
}
] ,
"id" : 64553 ,
"name" : "Example" ,
"radius" : 123 ,
"type" : "Truck"
} ,
"error" : null
}
Input Geofence area identifier.
Partial geofence payload containing fields to change.
Show child parameters Polygon/polyline/rectangle coordinates.
Geofence shape type.
Possible enum values
polylinePolyline geofence.
rectangleRectangular geofence.
Returns Updated geofence.
Show child fields colorstring | null
optional Polygon/polyline/rectangle coordinates.
radiusnumber | null
optional Circle radius when the geofence is circular.
Geofence shape type.
Possible enum values
polylinePolyline geofence.
rectangleRectangular geofence.
Typed SDK error when update fails.
Show child fields Original cause when available.
HTTP method when the error came from a request.
API path when the error came from a request.
Request identifier from X-Request-Id when supplied.
const updated = await linxio.geofences. update (areaId, {
name: "Updated SDK Test Area" ,
});
if (updated.error) {
throw updated.error;
} {
"data" : {
"color" : "string" ,
"coordinates" : [
{
"lat" : -31.9523 ,
"lng" : 115.8613
}
] ,
"id" : 64553 ,
"name" : "Example" ,
"radius" : 123 ,
"type" : "Truck"
} ,
"error" : null
}
Input Geofence area identifier.
Returns Typed SDK error when archive fails.
Show child fields Original cause when available.
HTTP method when the error came from a request.
API path when the error came from a request.
Request identifier from X-Request-Id when supplied.
const archived = await linxio.geofences. archive (areaId);
if (archived.error) {
throw archived.error;
} {
"error" : null
}
Input Archived geofence area identifier.
Returns Typed SDK error when restore fails.
Show child fields Original cause when available.
HTTP method when the error came from a request.
API path when the error came from a request.
Request identifier from X-Request-Id when supplied.
const restored = await linxio.geofences. restore (areaId);
if (restored.error) {
throw restored.error;
} {
"error" : null
}
Input Geofence area identifier.
Returns Typed SDK error when delete fails.
Show child fields Original cause when available.
HTTP method when the error came from a request.
API path when the error came from a request.
Request identifier from X-Request-Id when supplied.
const deleted = await linxio.geofences. delete (areaId);
if (deleted.error) {
throw deleted.error;
} {
"error" : null
}
Input listGroups() does not take parameters.
Returns Area group records.
Show child fields Typed SDK error when groups cannot be loaded.
Show child fields Original cause when available.
HTTP method when the error came from a request.
API path when the error came from a request.
Request identifier from X-Request-Id when supplied.
Returns Area group record.
Show child fields Typed SDK error when the group cannot be loaded.
Show child fields Original cause when available.
HTTP method when the error came from a request.
API path when the error came from a request.
Request identifier from X-Request-Id when supplied.
Input Object parameter. Expand to see child parameters.
Show child parameters Returns Created area group.
Show child fields Typed SDK error when group creation fails.
Show child fields Original cause when available.
HTTP method when the error came from a request.
API path when the error came from a request.
Request identifier from X-Request-Id when supplied.
Input Object parameter. Expand to see child parameters.
Show child parameters Returns Updated area group.
Show child fields Typed SDK error when group update fails.
Show child fields Original cause when available.
HTTP method when the error came from a request.
API path when the error came from a request.
Request identifier from X-Request-Id when supplied.
Returns Typed SDK error when group archive fails.
Show child fields Original cause when available.
HTTP method when the error came from a request.
API path when the error came from a request.
Request identifier from X-Request-Id when supplied.
const archived = await linxio.geofences. archiveGroup (groupId);
if (archived.error) {
throw archived.error;
} {
"error" : null
}
Input Archived area group identifier.
Returns Typed SDK error when group restore fails.
Show child fields Original cause when available.
HTTP method when the error came from a request.
API path when the error came from a request.
Request identifier from X-Request-Id when supplied.
const restored = await linxio.geofences. restoreGroup (groupId);
if (restored.error) {
throw restored.error;
} {
"error" : null
}
Returns Typed SDK error when group delete fails.
Show child fields Original cause when available.
HTTP method when the error came from a request.
API path when the error came from a request.
Request identifier from X-Request-Id when supplied.
const deleted = await linxio.geofences. deleteGroup (groupId);
if (deleted.error) {
throw deleted.error;
} {
"error" : null
}
Users, Clients, Drivers, and Resellers
User management, client account users, driver assignment, and reseller account helpers.
Fuel transaction records, summaries, vehicle fuel rows, cards, fuel types, and transaction assignment.