Assets
Retrieve asset layout details
/a/Asset_getLayoutDetails
Read named asset fields and synthetic widgets for a configurable CRM2 asset layout.
When to use this endpoint
Use Asset_getLayoutDetails as the read route for the shared CRM2 Asset layout map.
For a smaller programmatic lookup, Asset_getRequestedDetails exposes the same base map plus asset-specific location and owner enrichment.
Authentication and permissions
The request must authenticate with signed API-key fields or a logged-in CRM session. The handler performs no additional page or role-permission check.
The lookup and any write use the authenticated tenant; an ID from another tenant cannot be addressed through this call.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
fields | Array of strings | Yes | Requested Asset map keys. Recognized base fields are listed on Asset_createData. Unknown names are omitted; supported synthetic names are locationName, widgetQRCode, widgetTableContact, and widgetAssetServiceFrequency. |
id / ids | Integer string or array | No | Restrict to asset IDs. If both are supplied, id wins. Values are converted to integers. |
<mapped field> | Scalar or array | No | Recognized map keys become exact filters: text is trimmed and case-insensitive, numbers are integer-converted, and arrays become IN filters. Picker objects are split into their underlying ID/type filters. |
order | String/object or array | No | Mapped sort fields. Object form accepts id and exact dir: "desc"; invalid fields are ignored. |
advanceSearch | Array | No | Legacy mapped filter clauses. The raw where form is trusted-internal SQL and must not be built from user input. |
Example request
$rows = FM_api('Asset_getLayoutDetails', [
'id' => ['4821'],
'fields' => ['id', 'name', 'code', 'locationName', 'widgetQRCode', 'widgetTableContact'],
]);
Example response
[
{
"id": 4821,
"name": "Compressor 4",
"code": "CMP-004",
"locationName": "Northwind Service Centre",
"widgetQRCode": {
"url": "http://q.fieldmotion.com/asset/92442/4821",
"Name": "Compressor 4",
"Code": "CMP-004"
},
"widgetTableContact": []
}
]
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: fields"} | fields is absent. |
[] | No non-deleted asset satisfies all filters. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Soft-deleted assets are excluded. Archived and inactive assets remain unless explicitly filtered.
idis always appended and appears in each row. Temporary base fields added for a synthetic widget are removed unless the caller requested them too.locationNameresolves types0site,1customer,2asset, and3user using current names without deleted filtering.widgetQRCodealways uses anhttp://q.fieldmotion.com/asset/<tenant>/<asset>URL. Contact rows are converted through the layout widget map; service frequency is copied frommetaServiceFrequency.- The endpoint is read-only and performs no department- or owner-based visibility filtering beyond supplied map filters.
See it in Fieldmotion
CRM1
No direct production CRM1 caller was found.
CRM2
The shared Asset layout map registers this as its read route. Open an Asset create/edit layout and inspect its initial data load.
Related endpoints
Asset_createDatais the matching mapped create operation.Asset_updateDatais the matching mapped update operation.Asset_getRequestedDetailsadds owner, location, allocation, and cross-tenant legacy behavior.