查询单通外呼详情(QueryOutboundCallDetail)

更新时间:
复制为 MD 格式

根据通话ID查询单通外呼的完整详情,返回通话信息、客户信息、对话内容、录音地址、AI总结、标签和自定义扩展字段等全部数据。用于通话回溯和质量分析。

前提条件

请求参数

名称

类型

必填

描述

示例值

Action

String

要执行的操作。取值:QueryOutboundCallDetail

QueryOutboundCallDetail

Version

String

API版本号。格式为:YYYY-MM-DD。取值:2025-11-27

固定为2025-11-27

CallId

String

通话唯一标识

call-abc123def456

响应参数

名称

类型

描述

示例值

RequestId

String

请求ID。

xxxx-xxxx-xxxx

Success

Boolean

请求是否成功。

True

Code

String

错误码。请求成功时为空。

None

Message

String

错误信息或成功提示。

操作成功

Data

Object

返回数据,包含CallId, TaskId, CustomerId, CustomerName, PhoneNumber, CallStatus, CallTime, Duration, DialogContent, RecordUrl, Summary, Tags, Options, GmtCreate等字段,具体说明请参见下方返回参数说明。

使用示例

Python

import json
import os
from alibabacloud_tea_openapi import models as open_api_models
from alibabacloud_tea_openapi.client import Client as OpenApiClient
from alibabacloud_tea_util import models as util_models
from alibabacloud_openapi_util.client import Client as OpenApiUtilClient


def main():
    config = open_api_models.Config(
        access_key_id=os.getenv("ACCESS_KEY_ID"),
        access_key_secret=os.getenv("ACCESS_KEY_SECRET"),
    )
    config.endpoint = "thirdswaicall.aliyuncs.com"
    config.protocol = "HTTPS"
    client = OpenApiClient(config)

    params = open_api_models.Params(
        style="RPC",
        version="2025-11-27",
        action="QueryOutboundCallDetail",
        method="POST",
        pathname="/",
        protocol="HTTPS",
        auth_type="AK",
        req_body_type="json",
        body_type="json",
    )

    body = {'CallId': 'call-abc123def456'}

    request = open_api_models.OpenApiRequest(query=OpenApiUtilClient.query(body))
    runtime = util_models.RuntimeOptions(autoretry=True, max_attempts=3)
    try:
        resp = client.call_api(params, request, runtime)
        print(json.dumps(resp.get("body", {}), ensure_ascii=False, indent=2))
    except Exception as e:
        print(f"调用失败: {e}")


if __name__ == "__main__":
    main()

Java

import com.aliyun.teaopenapi.Client;
import com.aliyun.teaopenapi.models.Config;
import com.aliyun.teaopenapi.models.OpenApiRequest;
import com.aliyun.teaopenapi.models.Params;
import com.aliyun.teautil.models.RuntimeOptions;
import com.google.gson.Gson;

import java.util.HashMap;
import java.util.Map;

public class Demo {
    public static void main(String[] args) throws Exception {
        // 初始化配置
        Config config = new Config()
            .setAccessKeyId(System.getenv("ACCESS_KEY_ID"))
            .setAccessKeySecret(System.getenv("ACCESS_KEY_SECRET"))
            .setEndpoint("thirdswaicall.aliyuncs.com")
            .setProtocol("HTTPS");

        Client client = new Client(config);

        // 设置 API 参数
        Params params = new Params()
            .setStyle("RPC")
            .setVersion("2025-11-27")
            .setAction("QueryOutboundCallDetail")
            .setMethod("POST")
            .setPathname("/")
            .setProtocol("HTTPS")
            .setAuthType("AK")
            .setReqBodyType("json")
            .setBodyType("json");

        // 构建请求参数
        Map<String, Object> body = new HashMap<>();
        body.put("CallId", 1);

        OpenApiRequest request = new OpenApiRequest()
            .setQuery(com.aliyun.openapiutil.Client.query(body));

        // 设置运行时选项(自动重试)
        RuntimeOptions runtime = new RuntimeOptions()
            .setAutoretry(true)
            .setMaxAttempts(3);

        try {
            // 调用 API
            Map<String, ?> response = client.callApi(params, request, runtime);
            Gson gson = new Gson();
            System.out.println(gson.toJson(response.get("body")));
        } catch (Exception e) {
            System.err.println("调用失败: " + e.getMessage());
        }
    }
}

返回示例

{
  "Success": true,
  "Code": null,
  "Message": "操作成功",
  "RequestId": "xxxx-xxxx-xxxx",
  "Data": {
    "CallId": "call-abc123def456",
    "TaskId": 254,
    "CustomerId": 301,
    "CustomerName": "张三",
    "PhoneNumber": "13800138000",
    "CallStatus": "ANSWERED",
    "CallTime": "2026-04-10 10:00:00",
    "Duration": 150,
    "DialogContent": "[{\"role\":\"agent\",\"text\":\"您好\"}]",
    "RecordUrl": "https://oss-example.com/record/abc123.wav",
    "Summary": "客户对ECS续费有兴趣",
    "Tags": "[\"有意向\",\"需跟进\"]",
    "Options": "{\"priority\":\"high\"}",
    "GmtCreate": "2026-04-10 10:00:00"
  }
}

具体的处理结果在Data节点中,以下为Data节点的参数说明。

名称

类型

描述

示例值

CallId

String

通话唯一标识

call-abc123def456

TaskId

Number

关联的任务ID

254

CustomerId

Number

客户ID

301

CustomerName

String

客户名称

张三

PhoneNumber

String

手机号

13800138000

CallStatus

String

通话状态

ANSWERED

CallTime

String

通话时间

2026-04-10 10:00:00

Duration

Number

通话时长(秒)

150

DialogContent

String

对话内容(JSON格式)

[{"role":"agent","text":"您好"}]

RecordUrl

String

录音文件地址

https://oss-example.com/record/abc123.wav

Summary

String

AI通话总结

客户对ECS续费有兴趣

Tags

String

通话标签(JSON数组)

["有意向","需跟进"]

Options

String

自定义扩展字段(JSON对象)

{"priority":"high"}

GmtCreate

String

创建时间

2026-04-10 10:00:00

错误信息

如果执行报错,请参考错误信息进行解决。