Assets
List incomplete jobs for an asset
/a/Asset_getNextDate
List every non-deleted incomplete job directly assigned to an asset in scheduled-time order.
When to use this endpoint
Use Asset_getNextDate only when the caller needs the raw IDs, scheduled times, and assigned user IDs for incomplete jobs whose primary target is one asset.
Despite its singular name, the endpoint returns an unpaginated list rather than one next date.
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 does not separately require a logged-in user ID.
No page, role, or asset permission is checked.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | Integer string | Yes | Positive server-side asset ID used as meetings.customer_id with customer type 1. The asset row itself is not checked. |
Example request
$jobs = FM_api('Asset_getNextDate', [
'id' => '4821',
]);
Example response
[
{
"id": "81102",
"meeting_time_e": "1789122600",
"user_id": "307"
},
{
"id": "81440",
"meeting_time_e": "1789727400",
"user_id": "311"
}
]
Rows are ordered by meeting_time_e ascending. Database values normally remain JSON strings.
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 or does not convert to a positive integer. This validation runs before the tenant-context check. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Only direct asset-target jobs are included:
customer_type=1, matchingcustomer_id,is_complete=0, and not soft-deleted. - Jobs linked to the asset through secondary asset relationships are not included.
- A missing or soft-deleted asset ID is not an error and can still match jobs with that stored target ID.
- The endpoint has no date filter, page size, offset, or upper limit.
See it in Fieldmotion
CRM1
No direct production CRM1 call to Asset_getNextDate was found.
CRM2
No direct production CRM2 call to Asset_getNextDate was found.
Related endpoints
Asset_getLastVisitedreturns a fixed recent list of completed jobs, including secondary asset links.Asset_getcan confirm that the asset exists before this job lookup.