Jump to content

API getcdr

From Wiki 7Kas
(Redirected from API CDR General)

7Kas VoIP REST API function. Available to: SuperRoot, Operator, Client.

Description

Call Detail Records (CDR) for a period. One function serves all roles (CDR has no pricing columns). Clients see only their own account (accountcodeid is forced); operators their scope; SuperRoot everything. Served from SHM cache with PostgreSQL fallback.

Call

GET  …/7Kas?func=getcdr&ukey=YOUR_KEY&…

Requires the ukey parameter.

Parameters

Parameter Type Required Default Meaning
year integer Yes Year of the records (e.g. 2026).
month integer Yes Month, 1-12.
day integer No Filter by day of month (1-31).
hour integer No Filter by hour (0-23). (only valid together with day)
accountcodeid integer No Filter by account id. Ignored/forced to the caller's own for clients.
limit integer No 100 Max rows. SHM fast-path up to 10000, PostgreSQL fallback up to 1000.
offset integer No 0 Pagination offset.

Example

https://api.7kas.com:9080/7Kas?func=getcdr&ukey=KEY&year=2026&month=7&limit=100

Response

FillRecords2JSON records: {"RecordCount":N,"fields":[...],"1":[...],...}. Columns: calldate, clisrc, clidst, clid, src, dst, billsec, lastapp, disposition, uniqueid, channel, dstchannel, callfrom. callfrom = call-direction code (0 = undetermined, 1 = incoming/entrante, 2 = outgoing/saliente, 3 = incoming re-launched as outgoing). Source of truth: the COMMENT on tucall.voip_cdr.callfrom.

Column visibility by profile

Pricing/cost columns depend on the caller's profile (GOD LAW):

  • SuperRoot — provider cost + selling price + profit (VOC only).
  • Operator — account price + root price + profit (VOC only).
  • Client (direct, root=0) — only its own selling price (accountcode column).
  • Client (of operator, root>0) — only its own selling price (root column).

Back to API VoIP · ▶ Try it live · Profiles: API profile SuperRoot, API profile Operator, API profile Client (of operator), API profile Client (direct)