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

ParameterTypeRequiredDescription
idInteger stringYesPositive server ID or app ID. Both columns are tested in one query.
fieldsJSON array stringNoStored 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

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: 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 active or archived.
  • 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_array call expect an array and can emit warnings or terminate with a runtime type error.
  • When owner_name is requested and a positive owner_id was also selected, the response adds owner with the matching customer name or a blank string. The customer lookup has no active/deleted filter.
  • Requesting owner_name without owner_id leaves owner blank because the enrichment depends on the selected owner value.
  • Because the query tests id and appId without 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