Asset types
Export legacy asset-type CSV
/a/AssetTypes_export
Download the legacy Asset Types list as a fixed six-column CSV file.
When to use this endpoint
Use AssetTypes_export for CRM1’s Export Types button. It streams a file and terminates the request rather than returning JSON.
CRM2 uses AssetTypes_getExportData so users can choose and map fields.
Authentication and permissions
The handler requires an authenticated tenant context. CRM1 submits its CSRF token with the logged-in form post.
There is no explicit page, role, feature, or export permission check inside the handler.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
assetTypeID | Integer string | No | Positive ID filter. Zero, blank, or omission selects every ID. |
name | String | No | Case-insensitive substring filter over the stored name. Blank applies no filter. |
attrs | JSON array | No | Attribute-mask values for an SQL IN filter. Invalid/empty JSON applies no attribute filter. |
Example request
// Use an authenticated POST/download client, not a JSON decoder.
// CRM1 normally submits no filters to /a/AssetTypes_export.
[
'assetTypeID' => '47',
'name' => 'compressor',
'attrs' => json_encode(['0', '2']),
]
Example response
"Asset Type ID",Name,,,"Is A Vehicle","QR Code Url"
47,Compressor,,,Yes,https://example.test/assets
The response has Content-Type: text/csv, attachment filename asset_types.csv, two deliberately blank header/data columns, and rows ordered by ID ascending.
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. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Attribute masks
0/1export asNo,2/3asYes, and all other masks as?. - The QR URL is read from
meta.url; missing or invalid metadata produces a blank value. - All matching rows are exported with no pagination or row limit.
- The server writes
/tmp/<tenant>/tmp/asset_types.csv, overwriting the tenant’s previous file with that name and leaving it in place after streaming.
Side effects
- Creates or replaces a tenant-scoped temporary CSV file. No asset-type records are changed.
See it in Fieldmotion
CRM1
Open Assets → Setup Asset Types, choose Export Types, and inspect the form POST to AssetTypes_export. The production button sends no filters.
CRM2
No direct production CRM2 caller was found; CRM2 uses its mapped export workflow.
Related endpoints
AssetTypes_getDTsupplies CRM1’s paged on-screen table.AssetTypes_getExportDatasupplies mapped CRM2 export batches.