When to use this endpoint

Use Assets_getById after a list, change feed, or export translation supplies IDs. It adds owner, whereabouts, type-name, and Asset Table information beyond the raw selected fields.

Authentication and permissions

The request must authenticate with signed API-key fields or a logged-in CRM session. The handler requires login or an established tenant database context and performs no additional Asset-page or role-permission check unless the page says otherwise.

Every query and write uses the authenticated tenant’s tables. CRM1 and CRM2 may hide actions through client-side permissions that these collection routes do not repeat.

Parameters

ParameterTypeRequiredDescription
idsJSON array string or native arrayYesServer IDs or app IDs. Values are integer-converted, nonpositive values removed, and duplicates removed while preserving first occurrence.
fieldsJSON array string or native arrayNoAllowlisted stored fields: id, name, code, active, value, meta, last_edited, cdate, type_id, location_type, location_id, make, model, owner_id, archived, departments, warranty, book_id, custom_qr, contacts, and appId. Special type_name requests enrichment.

Example request

$assets = FM_api('Assets_getById', [
	'ids' => json_encode(['4821', '4822']),
	'fields' => json_encode(['id', 'name', 'type_id', 'type_name', 'owner_id', 'location_type', 'location_id']),
]);

Example response

[
  {
    "id": "4821",
    "name": "Compressor 4",
    "type_id": "17",
    "owner_id": "1042",
    "location_type": "1",
    "location_id": "1042",
    "type_name": "Compressor",
    "owner_name": "Example Engineering",
    "location_name": "Example Engineering",
    "table_data": {}
  }
]

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: ids"}The key is absent or does not decode to an array.
{"error":"no fields selected"}A supplied field list contains no stored allowlisted field. Requesting only type_name therefore fails.

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

Behaviour and edge cases

  • Rows exclude soft-deleted assets but include archived and inactive rows. A requested number may match either id or appId; result ordering and precedence are not guaranteed.
  • Owner enrichment adds customer identity, address, phone, email, industry, and parent fields without checking customer active/deleted state. These keys can overwrite same-named selected asset keys.
  • table_data is always appended and groups encoded row data by table ID, newest edited rows first. It queries the requested server-ID list, so app-ID-only matches may not receive their tables.

See it in Fieldmotion

CRM1

Export widgets and shared relationship translators batch IDs through this endpoint.

CRM2

CRM2 headers, export widgets, and relationship translation use the same batch route.

Related endpoints