查询通话记录列表 (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 定义显示顺序。

取值范围

  • asc:升序
  • desc:降序
sort_by String 定义排序字段。

取值范围

  • uid
  • time
  • call_type
  • last_status
  • call_duration
  • routing_duration
  • handling_duration
call_from String 主叫的号码和名称。
call_to String 被叫的号码和名称。

响应参数

参数 类型 说明
errcode Integer 返回错误码。
  • 0:请求成功。
  • 非零值:请求失败。
注: 更多错误码和错误信息说明,请参见 错误码 & 错误信息
errmsg String 返回信息。
  • SUCCESS:请求成功。
  • FAILURE:请求失败。
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 码。

Call_Note

参数 类型 说明
agent_name String 添加通话备注的分机用户的名称。
disposition_code_list Array<Disposition_Codes> 通话备注中选中的话务标签。
group_id String 通话备注的组 ID。
id String 通话备注的唯一 ID。
registration_time Long 分机用户添加通话备注的时间。
remark String 备注。

Disposition_Codes

参数 类型 说明
id Integer 话务标签的唯一 ID。
name String 话务标签。
description String 话务标签说明。

AI_Receptionist

参数 类型 说明
name String AI 接待员名称。
number String AI 接待员号码。
status String AI 接待员通话的处理结果。
  • resolved:AI 接待员成功解决了来电者的问题,未转接通话。
  • unresolved:AI 接待员将通话转接至其他目的地。
  • transfered:AI 接待员既未解决客户问题,也未转接通话。
  • noprocessingresult:通话因错误或超时异常结束,无法确定处理结果。
Queue
参数 类型 说明
name String 队列名称。
number String 队列号码。
status String 通话状态。
Ring_Group
参数 类型 说明
name String 响铃组名称。
number String 响铃组号码。
status String 通话状态。

示例

请求示例

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
        }
    ]
}