Assets
Retrieve one asset
/a/Asset_get
Retrieve selected stored fields for one non-deleted asset identified by its server ID or app ID.
When to use this endpoint
Use Asset_get after another call has supplied one asset identifier and the caller needs the stored record rather than a table-oriented projection.
Use the fields allowlist to reduce the result. This endpoint does not expand the encoded meta value or resolve type and location names.
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 |
|---|---|---|---|
id | Integer string | Yes | Positive server ID or app ID. Both columns are tested in one query. |
fields | JSON array string | No | Stored fields to return. Accepted names are id, name, code, active, value, meta, type_id, location_type, location_id, owner_id, appId, archived, departments, edited_uuid, warranty, book_id, custom_qr, last_edited, cdate, make, model, and contacts. Omission or an array with no accepted names selects the complete default set. The special requested name owner_name adds an owner field but is not selected from the asset row. |
Example request
$asset = FM_api('Asset_get', [
'id' => '4821',
'fields' => json_encode(['id', 'name', 'code', 'owner_id', 'owner_name']),
]);
Example response
{
"id": 4821,
"name": "Compressor 4",
"code": "CMP-004",
"owner_id": "1088",
"owner": "Example Engineering"
}
Only id is explicitly converted to a JSON number. Other database values normally remain strings, nullable columns remain null, and stored JSON such as meta and contacts remains encoded.
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 is absent or does not convert to a positive integer. This validation happens before the handler checks login. |
{"error":"requested asset does not exist"} | Neither the server ID nor app ID identifies a non-deleted asset. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- The query excludes soft-deleted assets but does not filter
activeorarchived. - Unknown field names are ignored. Duplicate names can produce duplicate SQL select expressions but only one JSON property.
- Malformed JSON or a decoded scalar is not safely normalized: the legacy loop and later
in_arraycall expect an array and can emit warnings or terminate with a runtime type error. - When
owner_nameis requested and a positiveowner_idwas also selected, the response addsownerwith the matching customer name or a blank string. The customer lookup has no active/deleted filter. - Requesting
owner_namewithoutowner_idleavesownerblank because the enrichment depends on the selected owner value. - Because the query tests
idandappIdwithout ordering, a numeric value that matches different rows in the two columns does not have a documented precedence. - This is a single-record lookup; it offers no search filtering or pagination.
See it in Fieldmotion
CRM1
Open a job form whose customer type is Asset, or use an asset-sourced quote note field, and filter Network requests for Asset_get. The job form supplies an explicit field list including the special owner_name request.
CRM2
No direct production CRM2 call to Asset_get was found. CRM2 asset screens use their shared asset model and broader detail/update contracts.
Related endpoints
Asset_getByBookIDlocates the full row from a book ID.Asset_getOwnerreturns only the owner ID and optional customer name.Asset_getLocationresolves the current location display data.