API getcdr: Difference between revisions
API docs (generated from func=help) |
API docs regenerated from func=help (operator catalogue) |
||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
''7Kas VoIP REST API function. Available to: ''' | ''7Kas VoIP REST API function. Available to: '''Operator, Client'''.'' | ||
== Description == | == Description == | ||
| Line 21: | Line 21: | ||
|- | |- | ||
| <code>accountcodeid</code> || integer || No || — || Filter by account id. Ignored/forced to the caller's own for clients. | | <code>accountcodeid</code> || integer || No || — || Filter by account id. Ignored/forced to the caller's own for clients. | ||
|- | |||
| <code>userfield</code> || string || No || — || Filter by tucloud PBX id (the CDR userfield column). One accountcode can host several PBXs, so accountcodeid alone does not isolate a switchboard. <small>(strict: rows whose userfield is empty never match)</small> | |||
|- | |- | ||
| <code>limit</code> || integer || No || <code>100</code> || Max rows. SHM fast-path up to 10000, PostgreSQL fallback up to 1000. | | <code>limit</code> || integer || No || <code>100</code> || Max rows. SHM fast-path up to 10000, PostgreSQL fallback up to 1000. | ||
| Line 30: | Line 32: | ||
== Response == | == Response == | ||
FillRecords2JSON records: {"RecordCount":N,"fields":[...],"1":[...],...}. Columns: calldate, clisrc, clidst, clid, src, dst, billsec, lastapp, disposition, uniqueid, channel, dstchannel, callfrom. callfrom = | 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 == | == Column visibility by profile == | ||
| Line 40: | Line 42: | ||
---- | ---- | ||
Back to [[API VoIP]] · '''[[API Console|▶ Try it live]]''' · Profiles: | Back to [[API VoIP]] · '''[[API Console|▶ Try it live]]''' · Profiles: [[API profile Operator]], [[API profile Client (of operator)]], [[API profile Client (direct)]] | ||
[[Category:API Operator]][[Category:API Client]][[Category:API function]] | |||
Latest revision as of 13:47, 5 November 2026
7Kas VoIP REST API function. Available to: 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. |
userfield |
string | No | — | Filter by tucloud PBX id (the CDR userfield column). One accountcode can host several PBXs, so accountcodeid alone does not isolate a switchboard. (strict: rows whose userfield is empty never match) |
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 Operator, API profile Client (of operator), API profile Client (direct)