Opportunity statuses and referrals
Page and search the legacy CRM1 opportunity-status settings table
/a/OpportunityStatuses_getDT
Page and search the legacy CRM1 opportunity-status settings table.
When to use this endpoint
Page and search the legacy CRM1 opportunity-status settings table.
Authentication and permissions
Authenticate with signed API-key fields or a logged-in CRM session. The handler requires login but does not check a settings-page permission, role or record owner. All rows in this family belong to the authenticated tenant’s opportunity_statuses table.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
draw | Integer string | Yes | Echoed as an integer; presence rather than numeric format is checked. |
start / length | Integer strings | No | Defaults 0 / 10. Directly integer-coerced into SQL LIMIT; no nonnegative validation or maximum cap. |
order[0][column] / order[0][dir] | Native nested array | No | Column 0 sorts id; 1 and every other column sort name. Exact desc selects descending; all other values ascend. Defaults id ascending. |
search[value] | String | No | Trimmed lowercase substring search over name OR id. SQL LIKE % and _ remain wildcards. Other mapped filters are ignored. |
Example request
$table = FM_api('OpportunityStatuses_getDT', ['draw' => '1', 'start' => '0', 'length' => '10', 'order' => [['column' => '1', 'dir' => 'asc']], 'search' => ['value' => 'Negotiation']]);
Example response
{"data":[["1042","Negotiation"]],"draw":1,"recordsTotal":"4","recordsFiltered":"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: draw"} | Draw omitted. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Each positional row is [id, name]; both values and the two count values come from the database as strings. draw is an integer.
- recordsTotal counts all tenant labels; recordsFiltered counts the search matches before pagination. There is no secondary ID tie-breaker for repeated names.
- Invalid LIMIT or query failure has no dependable structured error contract. Use valid nonnegative offsets and positive page lengths.
- No built-in exclusion, tenant-feature gate or write side effect applies.
See it in Fieldmotion
CRM1
Open CRM1 Settings → General → Opportunity Statuses. pageSettingsOpportunityStatuses.js loads the legacy table, creates labels and saves inline name edits. CRM1 opportunity/customer screens and exports obtain the choices through OpportunityStatuses_list. Reload the settings table and use its search or page controls to observe this request.
CRM2
CRM2’s Opportunity Statuses settings screen (pageOpportunitySettingsStatuses.js) uses CommonList/CommonLists with type=opportunityStatus instead, not this table. No direct CRM2 settings caller to this endpoint was found. Reproduce this contract with the example request; do not assume that changing it changes CRM2’s CommonList choices.
Related endpoints
OpportunityStatuses_getDataTableis the mapped named-field alternative.OpportunityStatus_setNamesaves the CRM1 inline edit.