Asset types
Retrieve one asset type
/a/AssetType_get
Retrieve the complete stored row for one tenant asset type.
When to use this endpoint
Use AssetType_get when a legacy Asset Type or Asset screen needs the stored metadata, vehicle bitmask, rental type, and edit timestamp for one known ID.
For batched lookups use AssetTypes_getById; for CRM2 named fields use AssetType_getRequestedDetails.
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 asset-type ID. Validation happens before the handler’s login guard. |
Example request
$type = FM_api('AssetType_get', [
'id' => '47',
]);
Example response
{
"id": 47,
"name": "Compressor",
"meta": "{\"url\":\"https://example.test/assets\"}",
"last_edited": "2026-09-25 10:15:00",
"attrs": "2",
"rental_type_id": "0"
}
id is explicitly converted to an integer. Other database scalars remain legacy strings, and meta remains a JSON-encoded string.
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, zero, negative, or nonnumeric. |
{"error":"requested asset type does not exist"} | The positive ID is not present in the authenticated tenant. |
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 has no active/archive filter because asset types have neither status field.
- The complete physical row is returned; future schema columns would therefore also become response fields.
- This is a single-record lookup with no pagination.
See it in Fieldmotion
CRM1
Open an Asset Type edit page or an asset detail/history screen and filter Network requests for AssetType_get. CRM1 parses the returned meta string for its URL and legacy custom template.
CRM2
No direct production CRM2 caller was found. CRM2 uses AssetType_getRequestedDetails, AssetTypes_getById, and the configurable layout endpoints.
Related endpoints
AssetTypes_getByIdbatches selected IDs with a restricted field allowlist.AssetType_getCustomLayoutresolves the modern custom layout stored outside this row.