Tasks
Export selected task data
/a/Tasks_getExportData
Resolve CRM2 export columns for an explicit JSON batch of task IDs and translate selected relationships to names.
When to use this endpoint
Use Tasks_getExportData as the second stage of CRM2 export, after Tasks_getDataTable has collected filtered IDs.
Authentication and permissions
The request must authenticate with signed API-key fields or a logged-in CRM session. The handler calls the normal login guard but performs no additional task, page, role, ownership, or privacy-permission check.
All rows come from the authenticated tenant. Unless the page says otherwise, IDs, creator, assignee, and privacy do not restrict the result at handler level.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
_ids | Nonempty JSON array string | Yes | Task IDs. Members are integer-coerced; the endpoint does not independently enforce active/deleted state. |
fields | Nonempty JSON array string | Yes | Requested names. Allowed: appId, assigned_date, created_by, client_id, cdate, due_date, details, id, last_edited, privacy, resolution, status, subject, type, assigned_to, and notes. |
Example request
$rows = FM_api('Tasks_getExportData', [
'_ids' => json_encode(['318']),
'fields' => json_encode(['id', 'subject', 'status', 'type', 'assigned_to']),
]);
Example response
[
{
"task_id": "318",
"f0": "318",
"f1": "Confirm access details",
"f2": "Open",
"f3": "Customer follow-up",
"f4": "Alex Smith"
}
]
task_id is always included. Requested values are named f0, f1, and so on according to request position. Rows have no explicit order.
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":"_ids should be a JSON array of numbers"} | _ids is malformed, empty, or not a JSON array. |
{"error":"fields should be an array of requested field names"} | fields is malformed, empty, or not a JSON array. |
{"error":"unknown field name: ..."} | A requested non-custom name is outside the allowlist. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
type,created_by,assigned_to, andclient_idare replaced with task-type, user, or customer names when the stored ID is nonzero. Missing related rows become an empty string; zero remains the raw value.privacybecomes Private/Public andstatusbecomes New/Open/Closed/Archived. Duplicate requested names receive separatefNaliases but only the first occurrence is transformed.- Custom-looking field names containing a colon and pipe are parsed into an unused table-field structure and silently omitted from output.
- Notes preserve legacy quirks: one plain-text note becomes blank, one JSON-array note extracts
contentvalues, multiple notes join with|, and a task with no notes leaves the selected notes value equal to its task ID. - There is no pagination, row limit, privacy filter, or field for
time_spent.
See it in Fieldmotion
CRM1
No direct CRM1 caller was found; CRM1 downloads Tasks_export.
CRM2
Choose Export from the Tasks module. CRM2 first gathers IDs from Tasks_getDataTable, then its export widget calls this route for the selected field positions.
Related endpoints
Tasks_getDataTableis the filtered active-ID source.Tasks_exportstreams the fixed CRM1 CSV schema.