Local accounting agent connections
Read local accounting agent logs
/a/DataSync_getLogs
Retrieve tenant log history for a DataSync connection with the legacy polling window.
When to use this endpoint
Use the connection ID, not an instruction ID. Supply from/to for a historical window; omission retains the existing polling defaults.
Authentication and permissions
Use signed API-key authentication or a logged-in CRM session on the account’s routed host. API keys act as their owner; session requests require the dispatcher’s CSRF token where configured. Tenant rows and settings belong to that authenticated account.
No independent login or CRM2 accounting-role check appears in this handler. Use normal authenticated dispatcher access; tenant-context setup and dispatcher guards remain relevant.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | Integer-compatible | Yes | Positive DataSync record ID from DataSync_new or DataSyncs_list, not an instruction ID. |
from | Unix seconds | No | Explicit values integer-convert and clamp at zero, including 0. When omitted/null, starts at the 100th latest matching timestamp, otherwise earliest matching timestamp, otherwise 0. |
to | Unix seconds | No | Explicit values integer-convert and clamp at zero; historical and future values are honored. Omission/null defaults to server now minus 1 second. A bound below from returns an error. |
Example request
$result = FM_api('DataSync_getLogs', ['id'=>'14']);
Example response
{
"ok": 1,
"from": 1794474000,
"to": 1794477600,
"logs": [
{
"id": "52",
"cdate": "1794474000",
"type_name2": "sync",
"description": "Sync started",
"meta": "[]"
}
],
"types": [
"sync"
]
}
Database numeric values can be strings. Read the JSON error/warning fields as well as the HTTP status.
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"} | Missing, zero or negative ID. |
{"error":"to must be greater than or equal to from"} | The explicit/default window is reversed; no silent expansion is performed. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Filters type_name=datasync and obj_id=the selected DataSync ID, with inclusive cdate bounds. Does not require that the DataSync record still exists or has a local sync type.
- Returns id,cdate,type_name2,description,meta ordered cdate ascending, without an ID tie-breaker. meta remains encoded text; types is the sorted set of returned type_name2 strings.
- There is no page/offset/limit. The default lower timestamp approximates 100 recent entries, but timestamp ties or concurrent additions can return more.
- The handler has no explicit Core_requireLogin call; it uses the dispatcher’s authenticated tenant/DBP context. This omission is not a public cross-tenant log access contract.
Side effects
- Database reads only; no seen state, instruction completion or checkpoint changes.
See it in Fieldmotion
CRM1
Open Settings → Data Sync. The pageSettingsDataSync screen uses this route for the operation described above; filter browser Network requests by the exact function name. Local-agent setup is separate from the cloud Finance integrations. Open connection history; the UI supplies the connection ID and window bounds.
CRM2
Open Settings → Data Sync. The CRM2 pageSettingsDataSync screen retains this local-agent workflow; filter browser Network requests by the exact function name. Its screen permissions do not add a role check to this shared handler. Open connection history; the UI supplies the connection ID and window bounds.
Related endpoints
DataSync_get— Reload connection state.DataSync_getInstruction— Poll the instruction ID.Accounting_logsList— Select provider log IDs.