查询通话记录列表 (v2.0)
查询通话记录 (CDR) 列表。
注: 本文适用于 API 2.0 版本。
请求 URL
GET {base_url}/{api_path}/cdr/list?access_token={access_token}
请求参数
| 参数 | 是否必填 | 类型 | 说明 |
|---|---|---|---|
| page | 否 | Integer | 定义显示第几个页面。 注: 如果没有设置此参数,则默认返回第一页。
|
| page_size | 否 | Integer | 定义每页显示几项查询结果。 最大值:10000 注: 如果没有设置此参数,则默认每页返回 10000
项结果。
|
| order_by | 否 | String | 定义显示顺序。 取值范围:
|
| sort_by | 否 | String | 定义排序字段。 取值范围:
|
| call_from | 否 | String | 主叫的号码和名称。 |
| call_to | 否 | String | 被叫的号码和名称。 |
响应参数
| 参数 | 类型 | 说明 |
|---|---|---|
| errcode | Integer | 返回错误码。
注: 更多错误码和错误信息说明,请参见 错误码 & 错误信息。
|
| errmsg | String | 返回信息。
|
| total_number | Integer | 通话记录总数量。 |
| data | Array<CDR_Details> | 通话记录详细信息。 |
- CDR_Details
-
参数 类型 说明 id Integer 记录序号。 uid String 通话记录的唯一 ID。 time String 发起或接听该通通话的时间。 call_type String 通讯类型。 Inbound:呼入Outbound:呼出Internal:内部
call_from String 主叫的号码和名称。 call_from_name String 主叫名称。 call_from_number String 主叫号码。 call_to String 被叫的号码和名称。 call_to_name String 被叫名称。 call_to_number String 被叫号码。 second_participant String 第二个通话阶段的被叫。 second_participant_name String 第二个通话阶段被叫的名称。 second_participant_number String 第二个通话阶段被叫的号码。 last_participant String 最后一个通话阶段的被叫。 last_participant_name String 最后一个通话阶段被叫的名称。 last_participant_number String 最后一个通话阶段被叫的号码。 last_status String 通话的最终状态。 ANSWERED:已接NO ANSWER:未接ABANDONED:放弃BUSY:忙FAILED:失败VOICEMAIL:语音留言
queues Object<Queue> 队列信息和通话状态。 ivrs Array IVR 的名称和号码。 ring_groups Object<Ring_Group> 响铃组信息和通话状态。 call_flows Array 通话流程的名称和号码。 call_duration Integer 拨号开始到通话结束的时间。 routing_duration Integer 通话开始到通话被应答的时间。 handling_duration Integer 通话被应答到通话结束的时间,包括保持时长。 call_notes Object<Call_Note> 通话的备注信息。 disconnected_by String 挂断通话的一方。 Extension:内部分机External:外部号码System:其他方注: 当来电在最大等待时长内未被接听、通话因紧急号码抢占而被强制终止等情况时,挂断方记为System。
segments Integer 通话阶段的数量。 ai_receptionist Array<AI_Receptionist> AI 接待员信息。 source_trunks Array 来电从哪条中继呼入。 destination_trunks Array 去电从哪条中继送出。 dids Array 主叫拨打的号码以及该号码关联的名称。
outbound_caller_ids Array 被叫话机上显示的号码。 pin_codes Array 用于外呼的 PIN 码。
示例
请求示例
GET /openapi/v2.0/cdr/list?access_token=wiO21GxXLYmZABJBqsXy6oeIJ45Evr4T&page=1&page_size=2 HTTP/1.1
Host: yeastardocs.example.yeastarcloud.com
响应示例
HTTP/1.1 200 OK { "errcode": 0, "total_number": 277, "data": [ { "id": "67AE6498-7D80008A", "uid": "20260612100344A5466", "time": "2026/06/12 10:03:44", "call_type": "Outbound", "call_from": "Dialer", "call_from_name": "", "call_from_number": "Dialer", "call_to": "Becky<1002>", "call_to_name": "Becky", "call_to_number": "1002", "second_participant": "Queue 6400<6400>", "second_participant_name": "6400", "second_participant_number": "6400", "last_participant": "6400:Evelyn<3200>", "last_participant_name": "Evelyn", "last_participant_number": "3200", "last_status": "ANSWERED", "queues": [ { "name": "6400", "number": "6400", "status": "ANSWERED" } ], "ivrs": null, "ring_groups": null, "call_flows": null, "call_duration": 44, "routing_duration": 7, "handling_duration": 37, "call_notes": null, "disconnected_by": "Extension", "segments": 3, "source_trunks": [ "2839" ], "destination_trunks": [ "2839" ], "dids": null, "outbound_caller_ids": [ "6700" ], "pin_codes": null }, { "id": "67AE63FD-9D8000E7", "uid": "202606121000595F345", "time": "2026/06/12 10:00:59", "call_type": "Outbound", "call_from": "Dialer", "call_from_name": "", "call_from_number": "Dialer", "call_to": "Becky<1002>", "call_to_name": "Becky", "call_to_number": "1002", "second_participant": "Queue 6400<6400>", "second_participant_name": "6400", "second_participant_number": "6400", "last_participant": "6400:Evelyn<3200>", "last_participant_name": "Evelyn", "last_participant_number": "3200", "last_status": "ANSWERED", "queues": [ { "name": "6400", "number": "6400", "status": "ANSWERED" } ], "ivrs": null, "ring_groups": null, "call_flows": null, "call_duration": 50, "routing_duration": 7, "handling_duration": 43, "call_notes": null, "disconnected_by": "External", "segments": 3, "source_trunks": [ "2839" ], "destination_trunks": [ "2839" ], "dids": null, "outbound_caller_ids": [ "6700" ], "pin_codes": null } ] }