Opportunity statuses and referrals
Read selected opportunity-status labels and their mapped timestamps
/a/OpportunityStatus_getRequestedDetails
Read selected opportunity-status labels and their mapped timestamps.
When to use this endpoint
Read selected opportunity-status labels and their mapped timestamps.
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 |
|---|---|---|---|
fields | Native array | No | Defaults to all mapped aliases. id is always added. Unknown aliases are ignored. Supply nested arrays directly to FM_api; JSON strings are not decoded here. Aliases: id, name, cdate, lastEdited. |
id / ids | Positive integer string or nonempty native array | No | Optional validated selector. id takes precedence; malformed, nonpositive and explicitly empty native lists are rejected. IDs do not grant access outside the authenticated account. |
name / cdate / lastEdited | Scalar or native array | No | Additional filters are ANDed. Scalar text is lowercased/trimmed exact equality, not substring search; text arrays use lowercase membership. Numeric scalars use intval; numeric arrays retain numeric entries and empty numeric lists match none. |
order | Alias, native array of aliases or {id,dir} objects | No | Default has no ORDER BY. Each id is a mapped alias, not a record ID; only dir=desc selects descending. Unknown aliases are skipped. No pagination or limit is applied. |
advanceSearch | Native list of structured clauses | No | Each clause uses a mapped alias in column or id, supported condition (equal, contains, notEqual, greaterThan, greaterThanOrEqual, lesserThan, lesserThanOrEqual), scalar/native scalar-list value, optional AND/OR and balanced special parentheses. Raw where SQL is rejected. |
Example request
$rows = FM_api('OpportunityStatus_getRequestedDetails', ['id' => '1042', 'fields' => ['name', 'cdate', 'lastEdited']]);
Example response
[{"name":"Negotiation","cdate":"2026-10-10 09:00:00","lastEdited":"2026-10-10 09:30:00","id":"1042"}]
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. |
[] | No matching rows or a database read failure; these outcomes are not distinguished. |
{"error":"unsupported raw advanced search"} | A raw where clause is supplied. |
{"error":"unbalanced advanced search"} | Structured parentheses are unmatched. |
{"error":"missing or invalid parameter: orderDesc"} | Explicit direction is not asc/desc. |
{"error":"missing or invalid parameter: id"} | Invalid/nonpositive selector; the message names id or ids. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Mapped keys are id (integer), name (text), cdate (creation Unix seconds in storage), and lastEdited (last_edited Unix seconds in storage). Read responses convert both timestamps to SQL datetime strings using the database connection timezone; they are not Unix numbers.
- The response is a bare list, including for a single ID. Missing IDs are omitted, not represented by null placeholders. There is no default sort or pagination.
- No built-in/deleted/active filter is applied; this configuration table is physically deleted rather than soft-deleted. No email, cache write or other mutation occurs.
- Native selectors and query controls are validated before the helper runs. Explicit empty/nonpositive ID selectors are rejected; unknown mapped field names are still ignored.
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.
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_listsupplies picker labels.OpportunityStatus_getRequestedDetailsreads mapped fields.