Work areas and stock categories
Retrieve one raw work-area record
/a/Location_get
Load one complete stored location for the map editor or a job/customer address selector.
When to use this endpoint
Locations_get supplies IDs for the map, while this call loads the complete record before a replacement edit.
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 |
|---|---|---|---|
id | Integer-compatible | Yes | Tenant-local row ID; converted with intval. Positive ID required unless explicitly stated otherwise. |
Example request
$result = FM_api('Location_get', ['id'=>'1042']);
Example response
{"id":"1042","name":"Depot","lat":"54.6","lng":"-5.9","changes":"[]","last_edited":"2026-10-03 10:30:00","address":null,"user_id":"0","customer_type":"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. |
{"error":"missing or invalid parameter: id"} | ID missing or nonpositive. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Returns the ten legacy raw columns, not mapped aliases. Database scalars remain strings and nullable values remain null; soft-delete metadata is not added to this response.
- Unknown positive IDs and database read failures return JSON
false, not a not-found error. There is no projection, pagination or enrichment. - 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
Open a location in Area Settings or edit its coordinates from an address selector; filter for Location_get. Stock and clock-in screens also load the raw record.
CRM2
Job address selection and Users Clockins area navigation load this record; filter for Location_get. The Area Settings list itself initially uses Locations_get.
Related endpoints
Locations_listselects raw location fields, optionally by user association.Location_getRequestedDetailsuses the mapped CRM2 field names.