Assets
List direct asset job IDs
/a/Asset_listJobs
Return the IDs of non-deleted jobs directly assigned to one asset.
When to use this endpoint
Use Asset_listJobs for the CRM1 pre-delete warning that checks whether an asset has direct jobs.
It is not a job-detail list and it does not include jobs associated only through the legacy asset/job link table.
Authentication and permissions
The handler requires an authenticated tenant context, established by signed API-key fields or a CRM session. It checks the tenant table prefix but performs no page, role, or asset permission check.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | Integer string | Yes | Positive asset ID. The asset row itself is not looked up. |
Example request
$result = FM_api('Asset_listJobs', [
'id' => '4821',
]);
Example response
{
"jobs": [
{"id": "7719"},
{"id": "7791"}
]
}
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":"invalid or missing parameter: id"} | id is absent, zero, or otherwise not positive. |
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 does not require a corresponding non-deleted asset, so a deleted or nonexistent asset ID simply returns any matching job rows or an empty array.
- Only the
idfield is returned. There is no search, pagination, or explicit ordering. - The endpoint is read-only.
See it in Fieldmotion
CRM1
Delete an asset from the Assets table or a customer’s Assets tab. CRM1 calls Asset_listJobs to decide whether to show its job warning before the delete call.
CRM2
No direct production CRM2 caller was found.
Related endpoints
Asset_deleteperforms the subsequent soft delete.Asset_exportJobsexports direct and linked jobs with display columns.