知识中心
所有文章
帮助中心
AI客户联络中心 升级日志
API文档
AI客户联络
API接口
【新】云节点列表
对话接口
白标接口及地址
【更新】通话详情
最后更新于 2023/10/11   阅读数 906

通话详情

  • URL/agent-api/user/{id}/task/{task_id}/detail/{record_id}

  • MethodGET

  • 需要鉴权

💡 注意:

  1. 原请求地址为GET /agent-api/task/{task_id}/detail/{record_id},新增参数用户id,且为必填

  2. 如果仍使用老版本的接口,将使用系统默认的云节点ID,无法操作其他云节点的数据

  3. 老版接口将于2023年2月1日下线,请尽快进行更换

路由参数

参数

类型

必填

描述

id

string

Y

账号ID

task_id

string

Y

任务ID

record_id

string

Y

通话记录ID

请求参数(new)

参数

类型

必填

描述

sub_user_id

string

N

子账户id(传递此参数则是对子账户操作)

  • 示例

    {
        "sub_user_id": "1f221144-630e-4d8e-a85e-d781e797cb96",//非必填 子账户ID  (传递此参数则是对子账户操作)
    }
    
    1
    2
    3
    json

请求示例

GET /agent-api/user/4d99d91c-f5d9-49da-88da-758977cc58a9/task/287e19c4-1966-49d6-8f02-b53ef11c0a55/detail/50971322-2e84-4701-836c-fd1181306885

成功响应

条件:任务存在、账号存在、通话记录存在。

状态码:200 OK

响应示例

{
    "code": 200,
    "status": "success",
    "message": "查看通话记录详情成功",
    "data": {
        "records": [
            {
                "id": "9dd21a47-2fd0-4632-9d28-ff6621501fd9",
                "record_id": "c431f832-6044-44c1-bd4a-a65879bc6163",
                "task_id": "c2a00c66-a9b6-4a1b-bae3-62554fbcba08",
                "notify": "enter",
                "callid": "4fc614e3-65de-4486-b2ea-16bf16e632d3",
                "error_code": 0,
                "asrtype": null,
                "callee": "17838463327",
                "gender": null,
                "asr_elapse": null,
                "record_ms": null,
                "volume_gain": null,
                "question": "",
                "split_question": null,
                "question_index": 0,
                "speak_ms": 0,
                "play_ms": 0,
                "keyword": null,
                "answer_id": "1e4b7a32-f3b4-4a8d-9a05-59a81fac2c40",
                "answer_text": "1开场白",
                "answer_content": "喂,您好(停顿1秒)哎您好,我这边是办理银行贷款的客户经理,我行在冲刺季度放款量特推出贷款新政策,现可办理月息2.95厘的贷款,最高可以申请500万,您最近有没有申请备用金的打算呢?\n您好,请问您是ai_5225271的弟弟吗",
                "word_class": "16",
                "answer_action": null,
                "playback_after_action": 0,
                "upstream_answer_action": null,
                "upstream_answer_content": null,
                "upstream_answer_text": null,
                "upstream_answer_id": null,
                "score": 200,
                "sequence": 1,
                "created_at": "2023-07-03 15:21:44",
                "updated_at": "2023-07-03 15:21:44",
                "bridge_status": null,
                "user_id": "40863af8-db4a-41c6-a269-eb5bc386d97f",
                "is_regular": 0,
                "expression": null,
                "extra": null,
                "contents": [
                    {
                        "id": "4cf4bd8f-0aa1-46d3-8c9c-7c911cadad63",
                        "file_id": null,
                        "sort": 1,
                        "status": true,
                        "translate_text": "您好,请问您是{$name}的弟弟吗"
                    },
                    {
                        "id": "75feec59-37fe-4d34-bc59-e66898aa8558",
                        "file_id": "7b0dcc9f-d16e-47ba-bb7f-2ba90b7c031f",
                        "sort": 0,
                        "status": true,
                        "translate_text": "喂,您好(停顿1秒)哎您好,我这边是办理银行贷款的客户经理,我行在冲刺季度放款量特推出贷款新政策,现可办理月息2.95厘的贷款,最高可以申请500万,您最近有没有申请备用金的打算呢?"
                    }
                ],
                "tags": [],
                "outbound_collection_record": null,
                "download_voice": [
                    [
                        "https://ai.telrobot.top/api/agent-api/download-voice?key=ZTdwdjR1ZWN5b1M1NDZzbjFlbFBlQVQzMDJ5ZWh2ODduVEdVUGRwV1pNS0RBR1F3Z01nYnRqcDhMR0VYbXhYTldHK3VqZ1RaT2w0ZnlRL0NQZ3dKd1hHcFVkc01vQ0N6VzI3NXQveTdpVnZZS1NMb1d5aGJRb1FDY2c0L1VuNHJZYVRXRWhyY09TZzNwT0FuTFhWZ2p0aFBSL0tvSXpnL3F4Uzg1dHFYQUpzb3RuVW05dXBKeExHcE9YU3dLOU5oOWFpTkxVajlLdUkrWkRza0lhRXhTcDVxT2Q2TEI0ZlVRamNzQytIcDZodmpTVFJuekh1aCt5TStkeXloendyQVdqdTAyd0NJZTkxdmpZL25ZM00rQU83dGtIK1FvdlNQWUJLOVoyejB2OHVDb0tYTmhua3BSY0pOVzE1V3M4OGZESHg3bVZCbXdtNXFWMTZPVG5VbHJEd3Fkd21wS3RUdExHNk1GOHJBK1Y0ZTVRdTRkbHpvVjlKVTh6a3RmRW5kUC9vK0pLZlRRQ3ZYaWpFcHZsT2xWd3RyZ1Vnb005K0lzZSswN2JWa0Vkbz0="
                    ],
                    [
                        "https://ai.telrobot.top/api/agent-api/download-voice?key=eThUS0x1bVZPQmVlUlhDR0lZWW9MMDFLSk9rdTNmV2tFRGZLcmhzb0NqWXh1ZTYvN2RhVDFtL0F2c3k0dVY2dVdHK3VqZ1RaT2w0ZnlRL0NQZ3dKd1hHcFVkc01vQ0N6VzI3NXQveTdpVnVidXB6MEpTSVZzNnpLL2RoaGFIaExZSXEvWklGdm1GQXh3WFhKb2pCcEphbUhrZ05veitZRmlXRS9OdDJmc2R1bmZ2ejBMeXNyK25kWkxkYUZNSmxkNUVseGJnOVNlS2NCeEgzQTBybG5zVUNiaCtabVVpcXNQOWJ5NFhxUmlxWUxRS0FZa1dkSVgyUlF0S05SRjFqWlc3Si9nTTV5eXVoTnVDaEZKMzgzYWF1Mnd1cHZKeU45YmRXbWRVWUVCcGVpaXFRSkhSc2hjd2wyR1NFY0hFY2VTeW52QWUzOE14UG42YngyejI0SjJ5eVVkQ1hyclo3T3VBaU93bWpZMXNWcWViMGpoa0UxazJrTkd5NnRWdlRU"
                    ]
                ],
                "voice": ""
            }
        ],
        "is_crm_exists": true,
        "user_id": "40863af8-db4a-41c6-a269-eb5bc386d97f",
        "info": {
            "record": {
                "id": "c431f832-6044-44c1-bd4a-a65879bc6163",
                "task_id": "c2a00c66-a9b6-4a1b-bae3-62554fbcba08",
                "group_id": 17089,
                "callid": "4fc614e3-65de-4486-b2ea-16bf16e632d3",
                "score": 200,
                "callee": "17838463327",
                "caller_number": "202306071342",
                "duration": 19460,
                "error_code": 0,
                "gender": null,
                "level_id": "d0140e2b-dbb5-4490-baae-8d11e0eebd34",
                "calldate": "2023-07-03 15:21:31",
                "bill": 8060,
                "hangupcause": "NORMAL_CLEARING",
                "hangupdate": "2023-07-03 15:21:50",
                "answerdate": "2023-07-03 15:21:42",
                "bridge_callid": null,
                "bridge_number": null,
                "bridge_calldate": null,
                "bridge_answerdate": null,
                "hangup_disposition": 2,
                "created_at": "2023-07-03 15:21:44",
                "updated_at": "2023-07-18 09:04:57",
                "rounds": 0,
                "level_name": "评分高()",
                "read_at": "2023-07-18 09:04:57",
                "province_id": 29,
                "city_id": 171,
                "operator": 3,
                "customer_id": "d6fe133d-aec9-4a83-896d-4de1eba34d5a",
                "user_id": "40863af8-db4a-41c6-a269-eb5bc386d97f",
                "processed_at": null,
                "number_created_at": "2023-06-09 18:23:03",
                "intention_results": 1,
                "level": {
                    "id": "d0140e2b-dbb5-4490-baae-8d11e0eebd34",
                    "name": "评分高",
                    "alias": null,
                    "color": "#FF5050"
                },
                "gender_str": "未知",
                "hangup_disposition_str": "客户",
                "crm_customer": {
                    "id": "d6fe133d-aec9-4a83-896d-4de1eba34d5a",
                    "user_id": "40863af8-db4a-41c6-a269-eb5bc386d97f",
                    "created_user_id": "40863af8-db4a-41c6-a269-eb5bc386d97f",
                    "phone": "17838463327",
                    "company": null,
                    "email": null,
                    "is_back": 0,
                    "source_id": 0,
                    "industry_id": 0,
                    "grade_id": 0,
                    "name": "ai_5225271",
                    "sort": 0,
                    "created_at": "2023-06-09 18:23:03",
                    "updated_at": "2023-07-03 15:21:44",
                    "inputted_at": "2023-06-09 18:23:03",
                    "viewed_at": null,
                    "province_id": 29,
                    "city_id": 171,
                    "operator": 3,
                    "flow": 1,
                    "extra": null,
                    "sex": 0,
                    "expect_transaction_at": null,
                    "expect_transaction_fee": "0.00",
                    "unfollow_back_at": null,
                    "unsettled_back_at": "2023-09-17",
                    "followed_at": "2023-07-03 15:21:44",
                    "components": [           
                        {
                            "id": "5039817b-5b9a-4f45-9587-57e6e5bac781",
                            "user_id": "40863af8-db4a-41c6-a269-eb5bc386d97f",
                            "name": "测试",
                            "type": "text",
                            "sort": 3,
                            "validate": [
                                "sometimes"
                            ],
                            "status": true,
                            "warehouse_id": 0,
                            "created_at": "2023-10-11 09:56:16",
                            "updated_at": "2023-10-11 09:56:16",
                            "data": {
                                "customer_id": "d6fe133d-aec9-4a83-896d-4de1eba34d5a",
                                "component_id": "5039817b-5b9a-4f45-9587-57e6e5bac781",
                                "value": "33424324242"
                            }
                        },]
                }
            },
            "task": {
                "uuid": "c2a00c66-a9b6-4a1b-bae3-62554fbcba08",
                "name": "xz0609",
                "create_datetime": "2023-06-09 18:22:43",
                "alter_datetime": "2023-07-12 14:27:25",
                "start": 0,
                "enable": false,
                "maximumcall": 1,
                "call_per_second": 10,
                "recycle_limit": 0,
                "random_assignment_number": 0,
                "disable_dial_timegroup": "89d62c45-a34c-4292-85f6-8af0cf40e1cf",
                "dial_time_id": 2540,
                "destination_extension": "17089",
                "destination_dialplan": "XML",
                "destination_context": "default",
                "scheduling_policy_ratio": null,
                "scheduling_queue": null,
                "dial_format": "{origination_caller_id_number=202306071342}sofia/gateway/202306071342/%s",
                "domain": null,
                "remark": null,
                "sort": 41,
                "originate_variables": "{execute_on_media=start_da,background=static/background/silence.wav}",
                "_originate_timeout": 60,
                "_origination_caller_id_number": "",
                "user_id": "40863af8-db4a-41c6-a269-eb5bc386d97f",
                "caller_line_id": "34f6cf2c-4971-4d19-8fec-58292fbce936",
                "auto_recycle_rule_id": 2585,
                "clue_configuration_id": null,
                "deleted_at": null,
                "call_notify_url": "http://192.168.0.4/api/tenant/69678406-467c-4094-9e27-8439a9118ce0/hangup_notify",
                "call_notify_type": 2,
                "call_pause_second": 0,
                "call_stop_notify_url": "http://192.168.0.4/api/tenant/69678406-467c-4094-9e27-8439a9118ce0/call_stop_notify",
                "call_notify_fail_stop": 0,
                "bridge_group_id": 256,
                "is_test": false,
                "is_top": 0,
                "empty_seat_stop": 0,
                "background_file_id": null,
                "background_file_name": null,
                "end_action": 1,
                "task_type": 1,
                "line_callee": "",
                "cache_number_count": 0,
                "group": {
                    "id": 17089,
                    "name": "贷款平台话术【复制】【复制】【复制】",
                    "user_id": "40863af8-db4a-41c6-a269-eb5bc386d97f",
                    "category_id": null,
                    "debug": false,
                    "deleted_at": null,
                    "created_at": "2023-06-09 10:46:18",
                    "updated_at": "2023-06-16 22:04:07",
                    "link_word_group_id": "0",
                    "tag_scene_id": "109d6549-c67b-4246-8342-5c9fd9dc04a3",
                    "exclusive_asr": "aliYun1",
                    "exclusive_tts": "aliyunv2_siyue",
                    "priority_matching": 0,
                    "is_top": 0,
                    "nlp_threshold": 60,
                    "order_matching": 0,
                    "sort": 0,
                    "usable": 1,
                    "inner": 0,
                    "is_sync": 0,
                    "speed": 50,
                    "volume": 50,
                    "is_lock": 0,
                    "default": false
                }
            }
        },
        "callee": null,
        "mobile_info": {
            "mobile_type": "移动",
            "province": "河南",
            "city": "洛阳"
        },
        "utterances": [
            {
                "id": "1e4b7a32-f3b4-4a8d-9a05-59a81fac2c40",
                "name": "1开场白",
                "description": "(打招呼是谁+来电目的、亮点展示并询问沟通意愿)",
                "group_id": 17089,
                "user_id": "40863af8-db4a-41c6-a269-eb5bc386d97f",
                "context_id": null,
                "priority": 1,
                "action": null,
                "word_class": 16,
                "wait": 5000,
                "retry": 0,
                "max_retry": 0,
                "score": 200,
                "play_ms": 1000,
                "enquire": true,
                "identify_type": 6,
                "is_node": 0,
                "node_label_id": null,
                "root_word_class": 16,
                "depth": 1,
                "deleted_at": null,
                "created_at": "2023-03-02 09:19:54",
                "updated_at": "2023-06-12 10:23:03",
                "background_file_id": null,
                "record_next_text": null,
                "block_asr": 0,
                "is_regular": 0,
                "top": null,
                "left": null,
                "hide": false,
                "allow_keyword_interrupt": false,
                "break_category_id": 0,
                "bridge_group_id": null,
                "is_jump_back": 0,
                "jump_back_threshold": -1,
                "action_normal_id": null,
                "is_blacklisted": 0,
                "blacklist_group_id": null,
                "collect_type": 0,
                "match_type": 0,
                "word_class_str": "主流程",
                "action_str": ""
            },
            {
                "id": "22b53664-a86a-4471-a52d-1d118fc9e50a",
                "name": "流程二",
                "description": "流程二",
                "group_id": 17089,
                "user_id": "40863af8-db4a-41c6-a269-eb5bc386d97f",
                "context_id": null,
                "priority": 10,
                "action": null,
                "word_class": 16,
                "wait": 3500,
                "retry": 0,
                "max_retry": 1,
                "score": 0,
                "play_ms": 1000,
                "enquire": true,
                "identify_type": 6,
                "is_node": 0,
                "node_label_id": null,
                "root_word_class": 16,
                "depth": 1,
                "deleted_at": null,
                "created_at": "2023-06-09 16:12:55",
                "updated_at": "2023-06-09 16:12:55",
                "background_file_id": null,
                "record_next_text": null,
                "block_asr": 2000,
                "is_regular": 0,
                "top": null,
                "left": null,
                "hide": false,
                "allow_keyword_interrupt": false,
                "break_category_id": 0,
                "bridge_group_id": null,
                "is_jump_back": 0,
                "jump_back_threshold": -1,
                "action_normal_id": null,
                "is_blacklisted": 0,
                "blacklist_group_id": null,
                "collect_type": 0,
                "match_type": 0,
                "word_class_str": "主流程",
                "action_str": ""
            }
        ]
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
plaintext

参数

类型

类型

records

array

通话详情(单句)

is_crm_exists

bool

是否存在于CRM公海

info.record

object

通话详情

info.task

object

所属任务详情

callee

string

被叫号码

mobile_info

object

被叫号码信息

utterances

array

使用的话数组的主流程

通话详情(单句)

参数

类型

类型

download_voice

array

机器人单句录音 

voice

string

客户单句录音

筛选可用通话记录

/**
 * 筛选可用的通话详情
 */
function getUsableRecords(records) {
    let usable = []
    records.forEach((item, index) => {
        let behinds = records.slice(index + 1)
        if (
            item.bridge_status || // 转接后的
            item.notify !== 'asrprogress_notify' || // 排除客户没说完话的
            (	item.notify === 'asrprogress_notify' && // 如果是客户没说完话,但是后边没有完整通话通知的
             	usable.every(u => u.question_index !== item.question_index) && 
             	behinds.every(b => b.notify !== 'asrmessage_notify')
            )
        ) {
            usable.push(item)
        }
    })
    return usable
}

/**
 * 给通话详情分类(转接前、转接后)
 */
function classifyRecords(records) {
    let before = [],
        after = []
    records.forEach(item => {
        if (!item.bridge_status) { // 没转接状态的是转接前的
            before.push(item)
        } else if ( // 有转接状态且没有重复问题的是转接后的
            item.bridge_status &&
            !after.find(i => i.question_index === item.question_index)
        ) {
			after.push(item)
        }
    })
    return {before, after}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
plaintext

错误响应

错误1

条件:任务ID不存在。

状态码200 OK

响应示例:

{
    "code": 5002,
    "status": "error",
    "message": "任务不存在",
    "data": []
}
1
2
3
4
5
6
plaintext

错误2

条件:账号ID错误,云节点不存在。

状态码200 OK

响应示例:

{
    "code": 1002,
    "status": "error",
    "message": "【user】参数错误,未找到对应云节点",
    "data": []
}
1
2
3
4
5
6
plaintext

错误3

条件:通话记录ID不存在。

状态码200 OK

响应示例:

{
    "code": 5005,
    "status": "error",
    "message": "该任务下的该通通话记录不存在",
    "data": []
}
1
2
3
4
5
6
plaintext

未能解决您的问题?请联系
本篇目录

通话详情

路由参数

请求参数(new)

请求示例

成功响应

错误响应

错误1

错误2

错误3