查询客户名单列表(QueryCustomerManagementList)
分页查询客户名单列表,支持按名单名称模糊搜索,按创建时间倒序返回。
前提条件
已安装 SDK。
已开通睿呼宝服务,并可访问目标工作空间。示例中的工作空间编码和资源 ID 需替换为实际值。
请求参数
名称 | 类型 | 必填 | 描述 | 示例值 |
Action | String | 是 | 要执行的操作。 | QueryCustomerManagementList |
Version | String | 是 | API 版本号。 | 2025-11-27 |
CurrentWorkspaceCode | String | 条件必填 | 工作空间编码。可在空间管理页面获取。仅有一个可访问空间时可省略,有多个空间时必填。 | workspace-code |
CustomerListName | String | 否 | 客户名单名称,支持模糊搜索。 | VIP客户 |
Current | Integer | 否 | 页码,从1开始,默认1。 | 1 |
Size | Integer | 否 | 每页条数,默认10。 | 10 |
请求示例
{
"CurrentWorkspaceCode": "workspace-code",
"Current": 1,
"Size": 10
}
响应参数
名称 | 类型 | 描述 | 示例值 |
RequestId | String | 请求追踪 ID;可能由响应头提供,响应体不保证包含此字段。 | request-example |
Success | Boolean | 请求是否成功。 | true |
Code | String | 响应码;成功为 SUCCESS,失败时为具体错误码。 | SUCCESS |
Message | String | 响应说明。 | 操作成功 |
Total | Long | 符合条件的总记录数。 | 1 |
Current | Integer | 当前页码。 | 1 |
Size | Integer | 每页条数。 | 10 |
Records | Array | 当前页记录,元素字段见下表。 | — |
使用示例
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.environ["ALIBABA_CLOUD_ACCESS_KEY_ID"],
access_key_secret=os.environ["ALIBABA_CLOUD_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="QueryCustomerManagementList",
method="POST", pathname="/", protocol="HTTPS", auth_type="AK",
req_body_type="json", body_type="json",
)
body = {'CurrentWorkspaceCode': 'workspace-code', 'Current': 1, 'Size': 10}
request = open_api_models.OpenApiRequest(body=OpenApiUtilClient.parse_to_map(body))
response = client.call_api(params, request, util_models.RuntimeOptions(autoretry=False))
print(json.dumps(response.get("body", {}), ensure_ascii=False, indent=2))
if __name__ == "__main__":
main()
Java
Java 示例使用 Java 8 及以上版本,并依赖 SDK 安装文档中的通用 OpenAPI SDK 和 Gson。
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 com.google.gson.reflect.TypeToken;
import java.util.Map;
public class Demo {
public static void main(String[] args) throws Exception {
Config config = new Config()
.setAccessKeyId(System.getenv("ALIBABA_CLOUD_ACCESS_KEY_ID"))
.setAccessKeySecret(System.getenv("ALIBABA_CLOUD_ACCESS_KEY_SECRET"))
.setEndpoint("thirdswaicall.aliyuncs.com").setProtocol("HTTPS");
Client client = new Client(config);
Params params = new Params()
.setStyle("RPC").setVersion("2025-11-27").setAction("QueryCustomerManagementList")
.setMethod("POST").setPathname("/").setProtocol("HTTPS").setAuthType("AK")
.setReqBodyType("json").setBodyType("json");
String requestJson = "{\"CurrentWorkspaceCode\": \"workspace-code\", \"Current\": 1, \"Size\": 10}";
Gson gson = new Gson();
Map<String, Object> body = gson.fromJson(requestJson,
new TypeToken<Map<String, Object>>() {}.getType());
OpenApiRequest request = new OpenApiRequest().setBody(body);
Map<String, ?> response = client.callApi(params, request,
new RuntimeOptions().setAutoretry(false));
System.out.println(gson.toJson(response.get("body")));
}
}
返回示例
{
"Success": true,
"Code": "SUCCESS",
"Message": "操作成功",
"Total": 1,
"Current": 1,
"Size": 10,
"Records": [
{
"CustomerListId": 100,
"CustomerListName": "VIP客户名单",
"TotalCustomers": 100,
"IsUsed": "1",
"GmtCreate": "2025-12-01 10:00:00",
"GmtModified": "2025-12-15 14:30:00"
}
]
}
Records 元素说明
名称 | 类型 | 描述 | 示例值 |
CustomerListId | Long | 客户名单ID | 100 |
CustomerListName | String | 客户名单名称。 | VIP客户名单 |
TotalCustomers | Long | 号码数量 | 100 |
IsUsed | String | 是否被外呼任务使用。0:未使用,1:已被使用。 | 1 |
GmtCreate | String | 创建时间。 | 2025-12-01 10:00:00 |
GmtModified | String | 最后修改时间。 | 2025-12-15 14:30:00 |
错误信息
请求失败时检查 Success、Code 和 Message。参数错误通常返回 BAD_REQUEST;资源不存在返回 NOT_FOUND,无访问权限返回 FORBIDDEN;其他错误参考错误信息。