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

ParameterTypeRequiredDescription
id / idsScalar integer-compatible or native arrayNoid 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.
fieldsNative arrayNoDefaults 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 filtersScalar or native arrayNoUse 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.
orderMapped name or native arrayNoOptional mapped field names or {id:field,dir:desc} objects. Invalid names ignored; omission has no sort.
advanceSearchNative arrayNoLegacy 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

ResponseCondition
{"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/www intermediary for this endpoint.
  • Rejects raw advanced-search where clauses 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