Jobs: lookups and details
Retrieve stored general stock for several jobs
/a/Jobs_getStock
Read the saved general stock blobs for selected active jobs without extracting form-table cells.
When to use this endpoint
Read the saved general stock blobs for selected active jobs without extracting form-table cells.
Authentication and permissions
Authenticate with signed API-key fields or a logged-in CRM session. These calls use the authenticated account’s data; the handler has no additional job-page, department, assignee or client-admin permission check unless stated below.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ids | Native array | Yes | Each value is converted to integer. JSON strings are not decoded. A truly empty native array is rejected; malformed/zero values are not individually rejected. |
Example request
$stock = FM_api('Jobs_getStock', ['ids' => ['1042', '1088']]);
Example response
[[{"id":201,"amt":2}],[{"id":202,"amt":1}]]
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: ids"} | ids is absent. |
{"error":"no ids?"} | A native empty array reaches the handler; form encoding may omit it. |
PHP/runtime failure rather than a stable JSON validation error | ids is not a native array. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Checks DBP for authenticated tenant context. The query excludes deleted jobs, without verifying every requested ID exists or applying assignee/department filters.
- Returns a list of decoded stock_used values only. Job IDs are not included and no SQL order is specified, so this is not a positional mapping to requested IDs.
- Blank stored values and the exact string [] are skipped. Whitespace variants, malformed JSON or other JSON types can still produce an entry such as null or an empty array.
- Duplicates in the request do not duplicate SQL IN rows; stock entries across jobs are not flattened, deduplicated or summed. No table-cell extraction, cost recalculation, paging or mutation occurs.
See it in Fieldmotion
CRM1
No direct CRM1 caller was found in the reviewed source. Use this focused API request when the full job editor payload is unnecessary.
CRM2
No direct CRM2 caller was found in the reviewed source. For batched job fields, see Jobs_getById.
Related endpoints
Job_getStockreturns general and fieldspecific data for one job.Jobs_getByIdcan include id alongside encoded stock_used when job attribution matters.