获取 AI 通话转写原文

获取指定通话记录的 AI 通话转写内容。

注: 该接口仅适用于 API 2.0 版本。

请求 URL

GET {base_url}/{api_path}/cdr/getaicontext?access_token={access_token}

请求参数

参数 是否必填 类型 说明
cdr_ids String 指定通话记录中的一个或多个通话阶段 ID。
注:
limit Integer 每页返回的最大记录数。
注: 此参数必须与 offset 同时使用才可生效。
offset Integer 页码 (从 1 开始)。
注: 此参数必须与 limit 同时使用才可生效。
search_value String 用于筛选转写内容的关键词。

响应参数

参数 类型 说明
errcode Integer 返回错误码。
  • 0:请求成功。
  • 非零值:请求失败。
注: 更多错误码和错误信息说明,请参见 错误码 & 错误信息
errmsg String 返回信息。
  • SUCCESS:请求成功。
  • FAILURE:请求失败。
data Object<Context> 包含了转写记录的数据对象,按通话阶段分组 (如 leg_1leg_2)。每个通话阶段包含了一个 context 数组,用于存放转写记录。
offset Integer 下一页记录的页码。
注: 若返回 -1,则表示已获取所有数据。
Context
参数 类型 说明
id string 转写记录的 ID。
content String 转写后的文本内容。
created_at integer 创建转写记录的时间戳 (单位:秒)。
timestamp integer 原始事件 (即用户说话的时刻) 发生的时间戳 (单位:毫秒)。
duration integer 该转写记录对应的原始语音的时长 (单位:秒)。
source_number string 说话人的号码。
type string 转写记录类型。
  • speak:语音转写记录。
avatar string 用户头像图片的文件路径或 URL。
name string 用户的显示名称。

示例

请求示例

GET /openapi/v2.0/cdr/getaicontext?access_token=Pjl6qkTPVSqPI2TqUHSJjhzTskh0R0gt&cdr_ids=20260513222941-586E2,20260513223234-3EE9E HTTP/1.1

Host: yeastardocs.example.yeastarcloud.com

响应示例

{
    "errcode": 0,
    "errmsg": "SUCCESS",
    "data": {
        "leg_1": {
            "context": [
                {
                    "id": "7000:1778682581785:1",
                    "content": "Hi",
                    "created_at": 1778682836,
                    "timestamp": 1778682581785,
                    "duration": 0,
                    "source_number": "7000",
                    "type": "speak",
                    "avatar": "https://linkus-cdn-hz.oss-cn-hangzhou.aliyuncs.com/aireceptionist/west-female-07.png",
                    "name": "Customer Service - AI Agent"
                },
                {
                    "id": "3200:1778682581785:2",
                    "content": "Hi. Hi, I got an urgent problem. Could you please help me as soon as possible?",
                    "created_at": 1778682836,
                    "timestamp": 1778682581785,
                    "duration": 0,
                    "source_number": "3200",
                    "type": "speak",
                    "avatar": "",
                    "name": "Kristin Hale"
                },
                {
                    "id": "7000:1778682581785:3",
                    "content": "Of course, I will help as quickly as I can. Please briefly describe the main issue in a few words, for example “login not working” or “payment failed.” Also, approximately how many users are affected by this urgent problem?",
                    "created_at": 1778682836,
                    "timestamp": 1778682588785,
                    "duration": 7,
                    "source_number": "7000",
                    "type": "speak",
                    "avatar": "https://linkus-cdn-hz.oss-cn-hangzhou.aliyuncs.com/aireceptionist/west-female-07.png",
                    "name": "Customer Service - AI Agent"
                },
                {
                    "id": "3200:1778682581785:4",
                    "content": "A login problem.",
                    "created_at": 1778682836,
                    "timestamp": 1778682603785,
                    "duration": 22,
                    "source_number": "3200",
                    "type": "speak",
                    "avatar": "",
                    "name": "Kristin Hale"
                },
                {
                    "id": "7000:1778682581785:5",
                    "content": "Thank you. I noted the issue keyword as login problem, with high urgency. Approximately how many users are affected, for example one person, your whole team, or the entire company? Also, when did this login problem first start, for example just now, earlier today, or yesterday?",
                    "created_at": 1778682836,
                    "timestamp": 1778682608785,
                    "duration": 27,
                    "source_number": "7000",
                    "type": "speak",
                    "avatar": "https://linkus-cdn-hz.oss-cn-hangzhou.aliyuncs.com/aireceptionist/west-female-07.png",
                    "name": "Customer Service - AI Agent"
                },
                {
                    "id": "3200:1778682581785:6",
                    "content": "Please answer the question one by one.",
                    "created_at": 1778682836,
                    "timestamp": 1778682624785,
                    "duration": 43,
                    "source_number": "3200",
                    "type": "speak",
                    "avatar": "",
                    "name": "Kristin Hale"
                },
                {
                    "id": "7000:1778682581785:7",
                    "content": "Understood, I will ask one question at a time. First question only now: Approximately how many users are affected by this login problem? For example, just you, your team, or everyone in the company.",
                    "created_at": 1778682836,
                    "timestamp": 1778682628785,
                    "duration": 47,
                    "source_number": "7000",
                    "type": "speak",
                    "avatar": "https://linkus-cdn-hz.oss-cn-hangzhou.aliyuncs.com/aireceptionist/west-female-07.png",
                    "name": "Customer Service - AI Agent"
                },
                {
                    "id": "3200:1778682581785:8",
                    "content": "60%.",
                    "created_at": 1778682836,
                    "timestamp": 1778682642785,
                    "duration": 61,
                    "source_number": "3200",
                    "type": "speak",
                    "avatar": "",
                    "name": "Kristin Hale"
                },
                {
                    "id": "7000:1778682581785:9",
                    "content": "Thank you, I have noted that as more than half of your users affected. Next question: When did this login problem first start? For example, just now, about one hour ago, this morning, or yesterday.",
                    "created_at": 1778682836,
                    "timestamp": 1778682646785,
                    "duration": 65,
                    "source_number": "7000",
                    "type": "speak",
                    "avatar": "https://linkus-cdn-hz.oss-cn-hangzhou.aliyuncs.com/aireceptionist/west-female-07.png",
                    "name": "Customer Service - AI Agent"
                },
                {
                    "id": "3200:1778682581785:10",
                    "content": "At nine o'clock in this morning.",
                    "created_at": 1778682836,
                    "timestamp": 1778682660785,
                    "duration": 79,
                    "source_number": "3200",
                    "type": "speak",
                    "avatar": "",
                    "name": "Kristin Hale"
                },
                {
                    "id": "7000:1778682581785:11",
                    "content": "Got it, first reported around nine o'clock this morning. Next question: Is there any temporary way people can still work, for example using a different system, guest access, or manual steps, or is everyone completely blocked from logging in?",
                    "created_at": 1778682836,
                    "timestamp": 1778682664785,
                    "duration": 83,
                    "source_number": "7000",
                    "type": "speak",
                    "avatar": "https://linkus-cdn-hz.oss-cn-hangzhou.aliyuncs.com/aireceptionist/west-female-07.png",
                    "name": "Customer Service - AI Agent"
                },
                {
                    "id": "3200:1778682581785:12",
                    "content": "There's not any work arounds",
                    "created_at": 1778682836,
                    "timestamp": 1778682672785,
                    "duration": 91,
                    "source_number": "3200",
                    "type": "speak",
                    "avatar": "",
                    "name": "Kristin Hale"
                },
                {
                    "id": "7000:1778682581785:13",
                    "content": "Thank you, I understand there is no temporary solution. Please wait while I check that for you.  \n\nCould you now describe what exactly happens when users try to log in? For example, do they see an error message, a blank page, or does nothing happen after they enter their username and password?",
                    "created_at": 1778682836,
                    "timestamp": 1778682676785,
                    "duration": 95,
                    "source_number": "7000",
                    "type": "speak",
                    "avatar": "https://linkus-cdn-hz.oss-cn-hangzhou.aliyuncs.com/aireceptionist/west-female-07.png",
                    "name": "Customer Service - AI Agent"
                },
                {
                    "id": "3200:1778682581785:14",
                    "content": "No idea what you were saying.",
                    "created_at": 1778682836,
                    "timestamp": 1778682693785,
                    "duration": 112,
                    "source_number": "3200",
                    "type": "speak",
                    "avatar": "",
                    "name": "Kristin Hale"
                },
                {
                    "id": "7000:1778682581785:15",
                    "content": "No problem, I will keep it simpler. When people try to log in, what do they see? For example, do they see an error message, or does the page just stay the same and not move?",
                    "created_at": 1778682836,
                    "timestamp": 1778682696785,
                    "duration": 115,
                    "source_number": "7000",
                    "type": "speak",
                    "avatar": "https://linkus-cdn-hz.oss-cn-hangzhou.aliyuncs.com/aireceptionist/west-female-07.png",
                    "name": "Customer Service - AI Agent"
                },
                {
                    "id": "3200:1778682581785:16",
                    "content": "An error message",
                    "created_at": 1778682836,
                    "timestamp": 1778682707785,
                    "duration": 126,
                    "source_number": "3200",
                    "type": "speak",
                    "avatar": "",
                    "name": "Kristin Hale"
                },
                {
                    "id": "7000:1778682581785:17",
                    "content": "Thank you. What exact words are shown in the error message, as closely as you can remember?  \n\nAlso, is this happening for all users who try to log in, or only some of them?",
                    "created_at": 1778682836,
                    "timestamp": 1778682710785,
                    "duration": 129,
                    "source_number": "7000",
                    "type": "speak",
                    "avatar": "https://linkus-cdn-hz.oss-cn-hangzhou.aliyuncs.com/aireceptionist/west-female-07.png",
                    "name": "Customer Service - AI Agent"
                },
                {
                    "id": "3200:1778682581785:18",
                    "content": "60% of my users",
                    "created_at": 1778682836,
                    "timestamp": 1778682721785,
                    "duration": 140,
                    "source_number": "3200",
                    "type": "speak",
                    "avatar": "",
                    "name": "Kristin Hale"
                },
                {
                    "id": "7000:1778682581785:19",
                    "content": "Thank you, so about sixty percent of users see an error message. Please tell me the exact words of that error message, as close as you can.  \n\nAfter that, I will know whether I should transfer you to the right technical person to handle this urgent login problem.",
                    "created_at": 1778682836,
                    "timestamp": 1778682726785,
                    "duration": 145,
                    "source_number": "7000",
                    "type": "speak",
                    "avatar": "https://linkus-cdn-hz.oss-cn-hangzhou.aliyuncs.com/aireceptionist/west-female-07.png",
                    "name": "Customer Service - AI Agent"
                },
                {
                    "id": "3200:1778682581785:20",
                    "content": "Just transfer me to an e-Human agent.",
                    "created_at": 1778682836,
                    "timestamp": 1778682741785,
                    "duration": 160,
                    "source_number": "3200",
                    "type": "speak",
                    "avatar": "",
                    "name": "Kristin Hale"
                }
            ]
        },
        "leg_2": {
            "context": [
                {
                    "id": "3202:1778682764808:3",
                    "content": "Hello, this is the human agent. How can I assist you?",
                    "created_at": 1778682821,
                    "timestamp": 1778682764808,
                    "duration": 0,
                    "source_number": "3202",
                    "type": "speak",
                    "avatar": "",
                    "name": "Human Agent"
                },
                {
                    "id": "3200:1778682764808:6",
                    "content": "Finally, a real person. I've been struggling with this login issue for hours.",
                    "created_at": 1778682821,
                    "timestamp": 1778682764808,
                    "duration": 0,
                    "source_number": "3200",
                    "type": "speak",
                    "avatar": "",
                    "name": "Kristin Hale"
                },
                {
                    "id": "3200:1778682764808:0",
                    "content": "About 60% of our users can't log in.",
                    "created_at": 1778682771,
                    "timestamp": 1778682772478,
                    "duration": 0,
                    "source_number": "3200",
                    "type": "speak",
                    "avatar": "",
                    "name": "Kristin Hale"
                },
                {
                    "id": "3200:1778682764808:1",
                    "content": "They keep seeing an error message.",
                    "created_at": 1778682772,
                    "timestamp": 1778682773248,
                    "duration": 0,
                    "source_number": "3200",
                    "type": "speak",
                    "avatar": "",
                    "name": "Kristin Hale"
                },
                {
                    "id": "3200:1778682764808:2",
                    "content": "But I don't know the exact wording.",
                    "created_at": 1778682778,
                    "timestamp": 1778682778008,
                    "duration": 1,
                    "source_number": "3200",
                    "type": "speak",
                    "avatar": "",
                    "name": "Kristin Hale"
                },
                {
                    "id": "3202:1778682764808:0",
                    "content": "That's okay. Can you describe what happens after entering the password?",
                    "created_at": 1778682777,
                    "timestamp": 1778682778168,
                    "duration": 0,
                    "source_number": "3202",
                    "type": "speak",
                    "avatar": "",
                    "name": "Human Agent"
                },
                {
                    "id": "3200:1778682764808:3",
                    "content": "The page just refreshes and asks for the password again.",
                    "created_at": 1778682781,
                    "timestamp": 1778682782088,
                    "duration": 1,
                    "source_number": "3200",
                    "type": "speak",
                    "avatar": "",
                    "name": "Kristin Hale"
                },
                {
                    "id": "3200:1778682764808:4",
                    "content": "No error code, no helpful message.",
                    "created_at": 1778682805,
                    "timestamp": 1778682805208,
                    "duration": 1,
                    "source_number": "3200",
                    "type": "speak",
                    "avatar": "",
                    "name": "Kristin Hale"
                },
                {
                    "id": "3202:1778682764808:1",
                    "content": "I see. Let me check the server logs for you.",
                    "created_at": 1778682805,
                    "timestamp": 1778682805328,
                    "duration": 1,
                    "source_number": "3202",
                    "type": "speak",
                    "avatar": "",
                    "name": "Human Agent"
                },
                {
                    "id": "3200:1778682764808:5",
                    "content": "Please do. And can you give me an estimated time for a fix?",
                    "created_at": 1778682807,
                    "timestamp": 1778682807578,
                    "duration": 1,
                    "source_number": "3200",
                    "type": "speak",
                    "avatar": "",
                    "name": "Kristin Hale"
                },
                {
                    "id": "3202:1778682764808:2",
                    "content": "I'll escalate this to our engineering team right away.",
                    "created_at": 1778682807,
                    "timestamp": 1778682807678,
                    "duration": 0,
                    "source_number": "3202",
                    "type": "speak",
                    "avatar": "",
                    "name": "Human Agent"
                }
            ]
        }
    },
    "offset": -1
}