Work areas and stock categories
Retrieve mapped work-area details
/a/Location_getRequestedDetails
Load location projections using CRM2 field aliases rather than raw database column names.
When to use this endpoint
Locations_getById is the raw-field batch alternative; choose this endpoint for latitude/customer aliases and mapped equality filters.
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 / ids | Scalar integer-compatible or native array | No | id takes precedence. Scalars become one integer ID; array values are integer-converted. Omitted IDs or an empty array impose no ID restriction; JSON text is not a batch list. |
fields | Native array | No | Defaults to every mapped field: id, name, latitude, longitude, changes, lastEdited, address, user, customerType, customer. Unknown names ignored; id automatically included. JSON strings are not decoded. |
Mapped field filters | Scalar or native array | No | Use mapped names id, name, latitude, longitude, changes, lastEdited, address, user, customerType, customer. Filters are ANDed: strings match trimmed case-insensitive equality; arrays use IN. Numeric scalar filters are integer-converted, even coordinates; numeric arrays retain only numeric members and integer-convert them. |
order | Mapped name or native array | No | Optional mapped field names or {id:field,dir:desc} objects. Invalid names ignored; omission has no sort. |
advanceSearch | Native array | No | Legacy advanced rules with column/id, condition and value; equal, notEqual, contains, greaterThan, greaterThanOrEqual, lesserThan, lesserThanOrEqual. andOr joins to the next rule (AND/OR/XOR), special adds parentheses. Raw where clauses are rejected. Use mapped-field rules only. |
Example request
$result = FM_api('Location_getRequestedDetails', ['ids'=>['1042'], 'fields'=>['name','latitude','longitude','customer']]);
Example response
[{"name":"Depot","latitude":"54.6","longitude":"-5.9","customer":"0","id":"1042"}]
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":"unsupported raw advanced search"} | An advanced rule includes raw where SQL. |
{"error":"missing or invalid parameter: fields"} | A supplied fields value is not a native string array. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Aliases latitude→lat, longitude→lng, lastEdited→last_edited, user→user_id, customerType→customer_type and customer→customer_id. Returned scalars are raw database values, not enriched user/customer records.
- No paging limit or name substring search; deleted rows are excluded. Empty IDs mean all matching rows, not an empty result.
- Unknown IDs are omitted; no matches and query failures both normalize to []. Use native arrays for fields and batched IDs.
- 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. - Rejects raw advanced-search
whereclauses and non-native fields/advanced-rule arrays before invoking the mapped helper.
Side effects
- Read-only; no object writes, audit entries or notifications are performed.
See it in Fieldmotion
CRM1
No direct CRM1 caller was found for this endpoint. The legacy Area Settings screen uses Locations_get and Location_get.
CRM2
CRM2’s list picker uses Location_getRequestedDetails for location choices; filter the function in browser Network. It uses mapped fields rather than lat/lng.
Related endpoints
Locations_listselects raw location fields, optionally by user association.Locations_getDataTableprovides paging, search and counts for mapped fields.