Assets
List asset jobs
/a/Assets_listJobs
Return non-deleted job IDs that overlap a local datetime range for selected assets.
When to use this endpoint
Use Assets_listJobs as the first stage of the CRM1 Asset Timeline. Pass its IDs to a Job batch lookup for full rows.
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
| Parameter | Type | Required | Description |
|---|---|---|---|
from / to | Datetime strings | Yes | Exact YYYY-MM-DD HH:MM:SS syntax in the tenant’s local time. Movement comparisons are inclusive; direct-job planned-time comparisons use an inclusive lower and exclusive upper bound. |
assets | Native array | Yes | Asset IDs. Positive integers are retained and then restricted to existing non-deleted assets. A JSON string is not decoded. |
form_id | Integer-compatible | No | When truthy, restricts matching jobs to this form ID. |
Example request
$ids = FM_api('Assets_listJobs', [
'assets' => ['4821', '4822'],
'from' => '2026-10-01 00:00:00',
'to' => '2026-10-07 23:59:59',
]);
Example response
["7719", "7732"]
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: from"} | from is absent. A present malformed value receives the longer format error. |
{"error":"missing or invalid parameter: to"} | to is absent. |
{"error":"invalid parameter: assets"} | No supplied asset ID remains 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
- Matches jobs linked by asset movement overlap, plus jobs whose primary customer is an asset and whose planned/completion interval overlaps the range.
- If no supplied IDs identify non-deleted assets, returns an empty array. Results are not explicitly ordered or deduplicated beyond the SQL query’s one row per job.
See it in Fieldmotion
CRM1
Open Assets → Timeline, choose dates and asset types, and filter for this request. CRM1 follows with Jobs_getSome.
CRM2
No direct production CRM2 caller was found.
Related endpoints
Assets_getCalendarreturns positional calendar event rows for direct asset jobs.Assets_getRecentAppointmentsreturns five completed maintenance jobs for one asset.