When to use this endpoint

Supply customerID to select one customer’s location tree. This namespace does not add that selection implicitly.

Authentication and permissions

Use signed API-key authentication or a logged-in CRM session. API keys act as their owner; session requests use dispatcher CSRF protection where configured. IDs and mapped queries address the authenticated tenant.

Login is required. CRM2 requests require Customers View. CRM2 TeamAccess scope applies to records and related data. These added CRM2 role/scope checks do not apply to CRM1 requests; CRM1 retains its legacy permission model. Tenant isolation and business validation apply to both clients.

Parameters

ParameterTypeRequiredDescription
id / idsPositive integer or native/JSON-encoded listYes for updates; optional for readsid takes precedence. Decimal integer strings are accepted and duplicates removed; invalid/nonpositive members reject the selection. Empty lists select no records. Omitted IDs on a read leave the other mapped filters in control.
fieldsNative list of mapped namesRequired for tables; optional for detailsDetails default to all mapped fields. Unknown projection names are omitted and id is included. JSON-encoded fields text is rejected.
Mapped filters / advanceSearchScalars, native lists or structured rulesNoMapped filters combine with AND; lists use IN. Detail quoted scalars use trimmed case-insensitive exact matching; table quoted scalars use substring LIKE. Advanced rules require a mapped column/id, value and one of equal, notEqual, contains, greaterThan, greaterThanOrEqual, lesserThan, lesserThanOrEqual; andOr and balanced special parentheses are validated. Raw where fragments and nonempty groupBy are rejected.
order / orderBy / orderDescMapped names/descriptors or DataTables orderNoUse mapped names and asc/desc. Tables accept DataTables column/dir ordering or named orderBy/orderDesc, with main.id ascending as a stable tie-breaker. Detail order accepts mapped names or {id,dir} descriptors; no detail pagination is applied.
start / length / drawInteger-compatibleNoTable defaults are 0/10/0. start is a nonnegative offset, length must be positive, draw is echoed as an integer. length=-1 is rejected; no route-specific maximum is imposed.
isTable / limitInteger-compatibleNoDefault table mode returns data, draw, recordsTotal and recordsFiltered. isTable=0 returns a data envelope without draw/counts; limit is a nonnegative unpaged cap (0 means uncapped).
searchValue / searchFieldText / mapped name or native listNoNonblank text performs case-insensitive substring LIKE; searchField defaults All. SQL LIKE % and _ retain wildcard meaning. Joined reference fields search their configured labels.
referenceDate / dateFrom / dateToMapped date name / integer day offsetsNoWith both bounds, select inclusive day boundaries relative to today in the account timezone (UTC fallback). Bounds are day offsets, not absolute dates. offsetFrom/offsetTo hour/minute objects adjust datetime boundaries; date-only fields ignore them. timeRangeFrom enables inclusive hour filtering, with timeRangeTo default 23; reversed hour bounds swap and the hour timezone defaults Europe/London.

Example request

$result = FM_api('CustomerAssetLocations_getDataTable', ['fields'=>['id','name','parentID','customerID'],'customerID'=>'1042','start'=>'0','length'=>'10']);

Example response

{
  "data": [
    {
      "id": "18",
      "name": "Ground floor",
      "parentID": "0",
      "customerID": "1042"
    }
  ],
  "draw": 0,
  "recordsTotal": "12",
  "recordsFiltered": "1"
}

Scalar numeric values may be strings or numbers depending on the database driver.

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": "missing or invalid parameter: fields"}fields is not a native list, or is absent in table mode.

Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.

Behaviour and edge cases

  • Details return a bare row array; plural table routes return a data envelope (draw/counts are omitted with isTable=0). Empty selections produce []/empty data. Database scalar types remain driver-dependent; whole JSON/text columns remain encoded strings. Counts respect the same CRM2 visibility boundary as the data; recordsFiltered includes the request filters.
  • Projects id, name, parentID, customerID and lastEdited. lastEdited is stored in seconds and returned as a database-formatted datetime string. Nodes are restricted to active owning Customers and CRM2 Customer scope only for CRM2. The response is flat; build the tree from parentID, with zero roots. Reads do not repair old cycles/orphans.
  • No direct caller of this exact namespace was found in the current mobile intermediary/app sources; mobile synchronization uses separate APIs.

Side effects

  • Reads only; no record, membership, queue or notification changes.

See it in Fieldmotion

CRM1

No direct caller was found in the current CRM1 JavaScript. This is separate from the general Locations screen and from the Asset owner/customer fields.

CRM2

In CRM2, open Customers > a record > Asset Location. The page reads nodes using customerID and writes parent moves with each stored node ID. Save waits for acknowledgements and verifies the stored parent with a fresh read before clearing the changed flag. Rejection stops dependent saves, re-enables Save and retains the draft; newer changes made during a save remain pending. The selected node’s Asset table uses Asset/Assets with locID.

Related endpoints