Work areas and stock categories
Load the legacy map location list
/a/Locations_get
Load the fixed location projection used by map settings and stock storage selectors.
When to use this endpoint
Location_edit updates an area after this fixed projection has populated the map. Use the list endpoint when you need last_edited or a custom projection.
These records represent work areas and map locations, not live user GPS positions or geofence definitions. Read IDs before editing; the stored user column is distinct from user-to-area membership.
Authentication and permissions
Authenticate using signed API-key fields or a logged-in CRM session. All object queries use the authenticated tenant. The handler has no additional page, role or feature check unless stated below.
Sign numeric request values as strings, including nested native arrays; only JSON-encode parameters that explicitly accept JSON text. See Getting started.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
user_id | Integer-compatible | No | Retained by the delegated list call; restricts to user-to-area links, not the location row’s user_id. |
Example request
$result = FM_api('Locations_get', []);
Example response
[{"id":"1042","name":"Depot","lat":"54.6","lng":"-5.9","address":null,"user_id":"0","customer_id":"0"}]
Errors and unusual responses
| Response | Condition |
|---|---|
{"error":"not logged in"} | No authenticated tenant context is available. Invalid signed credentials can be rejected by the dispatcher before the handler runs. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Delegates to
Locations_listwith fixed fields id, name, lat, lng, address, user_id, customer_id. Caller-supplied fields are overwritten; changes, last_edited and customer_type are omitted. - Because the internal call merges request values, an incoming user_id still filters by many-to-many area assignments. No pagination or ORDER BY is applied; no matches return [].
- Only non-deleted work areas are read or changed. No department or ownership restriction is applied. CRM1/CRM2 hide Area Settings with feature bit
524288, but these APIs do not enforce that UI restriction. - The source search found no direct caller in the mobile JavaScript app or its
m/wwwintermediary for this endpoint.
Side effects
- Read-only; no object writes, audit entries or notifications are performed.
See it in Fieldmotion
CRM1
Area Settings and Stock storage selectors call Locations_get on opening; filter by that function name.
CRM2
Area Settings initial loading calls Locations_get; filter by that name.
Related endpoints
Locations_listselects raw location fields, optionally by user association.Location_getRequestedDetailsuses the mapped CRM2 field names.