Utility

Utility endpoints provide helper operations that support application-specific workflows.

POST/utility/location-map-cache

Generates (or reuses) a static map image for a location, stores the file as an asset, and returns the image filename + URL for frontend use.

What It Does

  • Resolves the target location by locationId (supports current ID, master ID, or raw location ID).
  • If a previously cached filename exists on the location record and the file is present, returns it from cache.
  • Otherwise calls Geoapify Static Maps, saves the generated image into assets, and returns the new filename.
  • If a supported map filename field exists on aurora_locations, the endpoint also persists the new filename on that location row.

Request Body

{
  "locationId": 321,
  "latitude": -33.86,
  "longitude": 151.20,
  "zoom": 15,
  "width": 640,
  "height": 360,
  "forceRefresh": false
}

Request Parameters

  • locationId number required

    Location reference. The API attempts to match this against location row ID, current ID, and master ID.

  • latitude number

    Optional override coordinate. If omitted, values from the location row are used.

  • longitude number

    Optional override coordinate. If omitted, values from the location row are used.

  • zoom number

    Optional map zoom. Default: 15.

  • width number

    Optional image width in pixels. Default: 640.

  • height number

    Optional image height in pixels. Default: 360.

  • forceRefresh boolean

    When true, bypasses existing cached filename and regenerates a new map image.

Success Response

{
  "status": "Success",
  "fromCache": true,
  "locationId": 321,
  "locationField": "map_image",
  "persistedToLocation": true,
  "fileName": "501_location-map-321.png",
  "fileUrl": "https://api.infomaxim.com/assets/501_location-map-321.png"
}

Notes

  • The endpoint requires valid application context via standard Infomaxim app identity headers.
  • The API server must have a Geoapify API key configured (or supplied in request body for controlled integrations).
  • If no supported map field exists on aurora_locations, the endpoint still returns the generated asset filename and URL, but cannot persist the filename on the location row.