知识中心
所有文章
默认版本
默认版本
neibu
帮助中心
AI客户联络中心 升级日志
API文档
AI客户联络
API接口
【新】云节点列表
话术分组
iFrame嵌套
白标接口及地址
行业案例
【更新】通话详情
最后更新于 2022/11/14   阅读数 256

通话详情

  • 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

请求示例

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": "f224e1ea-e4a2-4d32-98b9-1570c78f8fa9",
                "record_id": "50971322-2e84-4701-836c-fd1181306885",
                "task_id": "287e19c4-1966-49d6-8f02-b53ef11c0a55",
                "notify": "enter",
                "callid": "ed26665c-873f-4917-a346-ce38cd2be7b5",
                "error_code": 0,
                "asrtype": null,
                "callee": "18555525545",
                "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": "",
                "answer_id": "4014b4cf-a820-4ae9-9533-f5d3e2be53fc",
                "answer_text": "流程一",
                "answer_content": "流程一茅盾出生在一个思想观念颇为新颖的家庭里,从小接受新式的教育。后考入北京大学预科,毕业后入商务印书馆工作,从此走上了改革中国文艺的道路,他是新文化运动的先驱者、中国革命文艺的奠基人之一。",
                "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": 0,
                "sequence": 1,
                "created_at": "2022-09-29 15:09:20",
                "updated_at": "2022-09-29 15:09:20",
                "bridge_status": null,
                "user_id": "4d99d91c-f5d9-49da-88da-758977cc58a9",
                "is_regular": 0,
                "expression": null,
                "contents": [
                    {
                        "id": "2edbbfa3-a7d1-4f23-b662-43561b2a50dc",
                        "file_id": "3728ea4b-9df8-40ed-920f-321f76863b9f",
                        "sort": 0,
                        "status": true,
                        "translate_text": "流程一茅盾出生在一个思想观念颇为新颖的家庭里,从小接受新式的教育。后考入北京大学预科,毕业后入商务印书馆工作,从此走上了改革中国文艺的道路,他是新文化运动的先驱者、中国革命文艺的奠基人之一。"
                    }
                ],
                "tags": []
            },
            {
                "id": "98fe9bb6-9a6a-4229-aa13-0b36cafb92b7",
                "record_id": "50971322-2e84-4701-836c-fd1181306885",
                "task_id": "287e19c4-1966-49d6-8f02-b53ef11c0a55",
                "notify": "asrprogress_notify",
                "callid": "ed26665c-873f-4917-a346-ce38cd2be7b5",
                "error_code": 0,
                "asrtype": "aliyunv2",
                "callee": "18555525545",
                "gender": 2,
                "asr_elapse": 478,
                "record_ms": 1450,
                "volume_gain": 3.5328300000000001,
                "question": "什么价格?",
                "split_question": null,
                "question_index": 1,
                "speak_ms": 0,
                "play_ms": 1700,
                "keyword": null,
                "answer_id": null,
                "answer_text": null,
                "answer_content": null,
                "word_class": null,
                "answer_action": null,
                "playback_after_action": 0,
                "upstream_answer_action": null,
                "upstream_answer_content": null,
                "upstream_answer_text": null,
                "upstream_answer_id": null,
                "score": 0,
                "sequence": 2,
                "created_at": "2022-09-29 15:09:20",
                "updated_at": "2022-09-29 15:09:20",
                "bridge_status": 0,
                "user_id": "4d99d91c-f5d9-49da-88da-758977cc58a9",
                "is_regular": 0,
                "expression": null,
                "contents": [],
                "tags": []
            },
            {
                "id": "60b0c5fe-547b-4291-830f-c5739c52730f",
                "record_id": "50971322-2e84-4701-836c-fd1181306885",
                "task_id": "287e19c4-1966-49d6-8f02-b53ef11c0a55",
                "notify": "asrprogress_notify",
                "callid": "ed26665c-873f-4917-a346-ce38cd2be7b5",
                "error_code": 0,
                "asrtype": "aliyunv2",
                "callee": "18555525545",
                "gender": 2,
                "asr_elapse": 748,
                "record_ms": 1830,
                "volume_gain": 10.519100999999999,
                "question": "你说的是什么?",
                "split_question": null,
                "question_index": 2,
                "speak_ms": 0,
                "play_ms": 4300,
                "keyword": null,
                "answer_id": null,
                "answer_text": null,
                "answer_content": null,
                "word_class": null,
                "answer_action": null,
                "playback_after_action": 0,
                "upstream_answer_action": null,
                "upstream_answer_content": null,
                "upstream_answer_text": null,
                "upstream_answer_id": null,
                "score": 0,
                "sequence": 3,
                "created_at": "2022-09-29 15:09:23",
                "updated_at": "2022-09-29 15:09:23",
                "bridge_status": 0,
                "user_id": "4d99d91c-f5d9-49da-88da-758977cc58a9",
                "is_regular": 0,
                "expression": null,
                "contents": [],
                "tags": []
            },
            {
                "id": "47d06fe0-062a-47a7-8201-15a7e5a73af6",
                "record_id": "50971322-2e84-4701-836c-fd1181306885",
                "task_id": "287e19c4-1966-49d6-8f02-b53ef11c0a55",
                "notify": "asrprogress_notify",
                "callid": "ed26665c-873f-4917-a346-ce38cd2be7b5",
                "error_code": 0,
                "asrtype": "aliyunv2",
                "callee": "18555525545",
                "gender": 2,
                "asr_elapse": 511,
                "record_ms": 1530,
                "volume_gain": 4.6577109999999999,
                "question": "加个微信吧。",
                "split_question": null,
                "question_index": 3,
                "speak_ms": 0,
                "play_ms": 7620,
                "keyword": null,
                "answer_id": null,
                "answer_text": null,
                "answer_content": null,
                "word_class": null,
                "answer_action": null,
                "playback_after_action": 0,
                "upstream_answer_action": null,
                "upstream_answer_content": null,
                "upstream_answer_text": null,
                "upstream_answer_id": null,
                "score": 0,
                "sequence": 4,
                "created_at": "2022-09-29 15:09:26",
                "updated_at": "2022-09-29 15:09:26",
                "bridge_status": 0,
                "user_id": "4d99d91c-f5d9-49da-88da-758977cc58a9",
                "is_regular": 0,
                "expression": null,
                "contents": [],
                "tags": []
            },
            {
                "id": "836126fc-c93f-4f5b-9b84-da359b680ec8",
                "record_id": "50971322-2e84-4701-836c-fd1181306885",
                "task_id": "287e19c4-1966-49d6-8f02-b53ef11c0a55",
                "notify": "asrprogress_notify",
                "callid": "ed26665c-873f-4917-a346-ce38cd2be7b5",
                "error_code": 0,
                "asrtype": "aliyunv2",
                "callee": "18555525545",
                "gender": 0,
                "asr_elapse": 381,
                "record_ms": 1070,
                "volume_gain": 11.723435,
                "question": "微信。",
                "split_question": null,
                "question_index": 4,
                "speak_ms": 0,
                "play_ms": 10640,
                "keyword": null,
                "answer_id": null,
                "answer_text": null,
                "answer_content": null,
                "word_class": null,
                "answer_action": null,
                "playback_after_action": 0,
                "upstream_answer_action": null,
                "upstream_answer_content": null,
                "upstream_answer_text": null,
                "upstream_answer_id": null,
                "score": 0,
                "sequence": 5,
                "created_at": "2022-09-29 15:09:29",
                "updated_at": "2022-09-29 15:09:29",
                "bridge_status": 0,
                "user_id": "4d99d91c-f5d9-49da-88da-758977cc58a9",
                "is_regular": 0,
                "expression": null,
                "contents": [],
                "tags": []
            }
        ],
        "is_crm_exists": true,
        "user_id": "4d99d91c-f5d9-49da-88da-758977cc58a9",
        "info": {
            "record": {
                "id": "50971322-2e84-4701-836c-fd1181306885",
                "task_id": "287e19c4-1966-49d6-8f02-b53ef11c0a55",
                "group_id": 8888,
                "callid": "ed26665c-873f-4917-a346-ce38cd2be7b5",
                "score": 1000,
                "callee": "18555525545",
                "caller_number": "0000000000",
                "duration": 39500,
                "error_code": 0,
                "gender": 2,
                "level_id": "23059613-da4c-4e52-94e1-42e3a5c0c40d",
                "calldate": "2022-09-29 15:09:13",
                "bill": 37140,
                "hangupcause": "NORMAL_CLEARING",
                "hangupdate": "2022-09-29 15:09:53",
                "answerdate": "2022-09-29 15:09:16",
                "bridge_callid": null,
                "bridge_number": null,
                "bridge_calldate": null,
                "bridge_answerdate": null,
                "hangup_disposition": 2,
                "created_at": "2022-09-29 15:09:19",
                "updated_at": "2022-10-19 14:56:42",
                "rounds": 2,
                "level_name": "A类客户()",
                "read_at": "2022-10-19 14:56:42",
                "province_id": 5,
                "city_id": 90,
                "operator": 2,
                "customer_id": "e973e23f-32da-44ea-921a-1988d2c5c7f2",
                "user_id": "4d99d91c-f5d9-49da-88da-758977cc58a9",
                "processed_at": null,
                "number_created_at": "2022-08-02 16:10:48",
                "intention_results": 1,
                "level": null,
                "gender_str": "男",
                "hangup_disposition_str": "客户",
                "crm_customer": {
                    "id": "e973e23f-32da-44ea-921a-1988d2c5c7f2",
                    "user_id": "00c7d089-e479-4a15-a8ee-a761d23bdbf5",
                    "created_user_id": "d6fdd973-a9b6-4e24-898f-01ff5684c7a7",
                    "phone": "18555525545",
                    "company": "123123",
                    "email": "123",
                    "is_back": 0,
                    "source_id": 4,
                    "industry_id": 4,
                    "grade_id": 0,
                    "name": "测试掉保时间1",
                    "sort": 0,
                    "created_at": "2021-11-29 22:18:16",
                    "updated_at": "2022-09-29 15:10:33",
                    "inputted_at": null,
                    "province_id": 5,
                    "city_id": 90,
                    "operator": 2,
                    "flow": 1,
                    "extra": null,
                    "sex": 1,
                    "expect_transaction_at": null,
                    "expect_transaction_fee": "0.00",
                    "unfollow_back_at": "2022-10-14",
                    "unsettled_back_at": "2022-11-28",
                    "followed_at": "2022-09-29 15:09:20",
                    "components": []
                },
                "bridge_records": []
            },
            "task": {
                "uuid": "287e19c4-1966-49d6-8f02-b53ef11c0a55",
                "name": "徐宁测试任务",
                "create_datetime": "2022-06-10 16:01:04",
                "alter_datetime": "2022-10-14 10:04:42",
                "start": 0,
                "enable": false,
                "maximumcall": 10,
                "call_per_second": 10,
                "recycle_limit": 0,
                "random_assignment_number": 0,
                "disable_dial_timegroup": "89d62c45-a34c-4292-85f6-8af0cf40e1cf",
                "dial_time_id": 2007,
                "destination_extension": "8888",
                "destination_dialplan": "XML",
                "destination_context": "default",
                "scheduling_policy_ratio": null,
                "scheduling_queue": null,
                "dial_format": "user/10003",
                "domain": null,
                "remark": null,
                "sort": 0,
                "originate_variables": "{execute_on_media=start_da}",
                "_originate_timeout": 60,
                "_origination_caller_id_number": "",
                "user_id": "4d99d91c-f5d9-49da-88da-758977cc58a9",
                "caller_line_id": "654ede99-dbbb-47a6-a5cc-6976bfcbbb28",
                "auto_recycle_rule_id": 103,
                "clue_configuration_id": 1,
                "deleted_at": null,
                "call_notify_url": "http://192.168.0.214/api/tenant/f2d216a3-9ea5-4f1d-a170-ce9ebed49eaf/hangup_notify",
                "call_notify_type": 2,
                "call_pause_second": 1,
                "call_stop_notify_url": "http://192.168.0.214/api/tenant/f2d216a3-9ea5-4f1d-a170-ce9ebed49eaf/call_stop_notify",
                "call_notify_fail_stop": 0,
                "bridge_group_id": 103,
                "is_test": false,
                "is_top": 1,
                "group": {
                    "id": 8888,
                    "name": "徐宁测试",
                    "user_id": "4d99d91c-f5d9-49da-88da-758977cc58a9",
                    "debug": false,
                    "deleted_at": null,
                    "created_at": "2022-05-07 09:21:22",
                    "updated_at": "2022-09-07 14:17:11",
                    "link_word_group_id": "1",
                    "tag_scene_id": "813a8a46-b7c0-4c3b-b05c-77da93ab9135",
                    "exclusive_asr": null,
                    "exclusive_tts": "aliyunv2_siyue",
                    "priority_matching": 0,
                    "default": false
                }
            }
        },
        "callee": "18561772287",
        "mobile_info": {
            "mobile_type": "联通",
            "province": "安徽",
            "city": "蚌埠"
        },
        "utterances": [
            {
                "id": "1103720e-d3dc-4aeb-a78b-d298a69c14b0",
                "name": "流程三",
                "description": "流程三",
                "group_id": 8888,
                "user_id": "4d99d91c-f5d9-49da-88da-758977cc58a9",
                "context_id": null,
                "priority": 10,
                "action": null,
                "word_class": 16,
                "wait": 3200,
                "retry": 0,
                "max_retry": 3,
                "score": 0,
                "play_ms": 2000,
                "enquire": true,
                "identify_type": 6,
                "is_node": 0,
                "node_label_id": null,
                "root_word_class": 16,
                "depth": 1,
                "deleted_at": null,
                "created_at": "2022-05-07 09:21:55",
                "updated_at": "2022-09-07 16:26:12",
                "background_file_id": null,
                "record_next_text": null,
                "block_asr": 500,
                "is_regular": 0,
                "top": null,
                "left": null,
                "hide": false,
                "allow_keyword_interrupt": false,
                "break_category_id": 1,
                "bridge_group_id": null,
                "is_jump_back": 0,
                "jump_back_threshold": -1,
                "action_normal_id": null,
                "is_blacklisted": 0,
                "blacklist_group_id": null,
                "word_class_str": "主流程",
                "action_str": ""
            },
            {
                "id": "4014b4cf-a820-4ae9-9533-f5d3e2be53fc",
                "name": "流程一",
                "description": "流程一",
                "group_id": 8888,
                "user_id": "4d99d91c-f5d9-49da-88da-758977cc58a9",
                "context_id": null,
                "priority": 10,
                "action": null,
                "word_class": 16,
                "wait": 3200,
                "retry": 0,
                "max_retry": 3,
                "score": 0,
                "play_ms": -1,
                "enquire": true,
                "identify_type": 6,
                "is_node": 0,
                "node_label_id": null,
                "root_word_class": 16,
                "depth": 1,
                "deleted_at": null,
                "created_at": "2022-05-07 09:21:35",
                "updated_at": "2022-09-29 13:52:44",
                "background_file_id": null,
                "record_next_text": null,
                "block_asr": 500,
                "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,
                "word_class_str": "主流程",
                "action_str": ""
            },
            {
                "id": "7b48d2c2-efe1-450f-a979-5bcf33e631d2",
                "name": "流程二",
                "description": "流程二",
                "group_id": 8888,
                "user_id": "4d99d91c-f5d9-49da-88da-758977cc58a9",
                "context_id": null,
                "priority": 10,
                "action": null,
                "word_class": 16,
                "wait": 3200,
                "retry": 0,
                "max_retry": 3,
                "score": 0,
                "play_ms": 2000,
                "enquire": true,
                "identify_type": 6,
                "is_node": 0,
                "node_label_id": null,
                "root_word_class": 16,
                "depth": 1,
                "deleted_at": null,
                "created_at": "2022-05-07 09:21:45",
                "updated_at": "2022-09-29 14:52:48",
                "background_file_id": null,
                "record_next_text": null,
                "block_asr": 500,
                "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,
                "word_class_str": "主流程",
                "action_str": ""
            },
            {
                "id": "8ad5ab22-a2c1-447f-a57f-89f9f9b69841",
                "name": "流程四",
                "description": "流程四",
                "group_id": 8888,
                "user_id": "4d99d91c-f5d9-49da-88da-758977cc58a9",
                "context_id": null,
                "priority": 10,
                "action": null,
                "word_class": 16,
                "wait": 3200,
                "retry": 0,
                "max_retry": 3,
                "score": 0,
                "play_ms": 2000,
                "enquire": true,
                "identify_type": 6,
                "is_node": 0,
                "node_label_id": null,
                "root_word_class": 16,
                "depth": 1,
                "deleted_at": null,
                "created_at": "2022-05-07 09:22:06",
                "updated_at": "2022-09-07 16:26:18",
                "background_file_id": null,
                "record_next_text": null,
                "block_asr": 500,
                "is_regular": 0,
                "top": null,
                "left": null,
                "hide": false,
                "allow_keyword_interrupt": false,
                "break_category_id": 1,
                "bridge_group_id": null,
                "is_jump_back": 1,
                "jump_back_threshold": 60,
                "action_normal_id": null,
                "is_blacklisted": 0,
                "blacklist_group_id": null,
                "word_class_str": "主流程",
                "action_str": ""
            },
            {
                "id": "c3ad3eb5-239b-44e8-b0c8-c4ab198104fc",
                "name": "流程六",
                "description": "流程六",
                "group_id": 8888,
                "user_id": "4d99d91c-f5d9-49da-88da-758977cc58a9",
                "context_id": null,
                "priority": 10,
                "action": null,
                "word_class": 16,
                "wait": 3200,
                "retry": 0,
                "max_retry": 3,
                "score": 0,
                "play_ms": 2000,
                "enquire": true,
                "identify_type": 6,
                "is_node": 0,
                "node_label_id": null,
                "root_word_class": 16,
                "depth": 1,
                "deleted_at": null,
                "created_at": "2022-05-12 11:31:58",
                "updated_at": "2022-08-26 13:08:32",
                "background_file_id": null,
                "record_next_text": null,
                "block_asr": 500,
                "is_regular": 0,
                "top": null,
                "left": null,
                "hide": false,
                "allow_keyword_interrupt": false,
                "break_category_id": 1,
                "bridge_group_id": null,
                "is_jump_back": 0,
                "jump_back_threshold": -1,
                "action_normal_id": null,
                "is_blacklisted": 0,
                "blacklist_group_id": null,
                "word_class_str": "主流程",
                "action_str": ""
            },
            {
                "id": "e29dd472-b145-4fc0-942a-439dc0f7cdd7",
                "name": "流程五",
                "description": "流程五",
                "group_id": 8888,
                "user_id": "4d99d91c-f5d9-49da-88da-758977cc58a9",
                "context_id": null,
                "priority": 10,
                "action": null,
                "word_class": 16,
                "wait": 3200,
                "retry": 0,
                "max_retry": 3,
                "score": 0,
                "play_ms": 2000,
                "enquire": true,
                "identify_type": 6,
                "is_node": 0,
                "node_label_id": null,
                "root_word_class": 16,
                "depth": 1,
                "deleted_at": null,
                "created_at": "2022-05-12 11:31:41",
                "updated_at": "2022-09-07 13:19:42",
                "background_file_id": null,
                "record_next_text": null,
                "block_asr": 500,
                "is_regular": 0,
                "top": null,
                "left": null,
                "hide": false,
                "allow_keyword_interrupt": false,
                "break_category_id": 1,
                "bridge_group_id": null,
                "is_jump_back": 0,
                "jump_back_threshold": -1,
                "action_normal_id": null,
                "is_blacklisted": 0,
                "blacklist_group_id": null,
                "word_class_str": "主流程",
                "action_str": ""
            }
        ]
    }
}

参数

类型

描述

records

array

通话详情(单句)

is_crm_exists

bool

是否存在于CRM公海

info.record

object

通话详情

info.task

object

所属任务详情

callee

string

被叫号码

mobile_info

object

被叫号码信息

utterances

array

使用的话数组的主流程

筛选可用通话记录

/**
 * 筛选可用的通话详情
 */
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

条件:任务ID不存在。

状态码200 OK

响应示例:

{
    "code": 5002,
    "status": "error",
    "message": "任务不存在",
    "data": []
}

错误2

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

状态码200 OK

响应示例:

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

错误3

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

状态码200 OK

响应示例:

{
    "code": 5005,
    "status": "error",
    "message": "该任务下的该通通话记录不存在",
    "data": []
}

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

通话详情

请求参数

请求示例

成功响应

错误响应

错误1

错误2

错误3