Query outbound task details (QueryOutboundTaskDetail)
Queries the complete details of an outbound task by task ID. Returns the task configuration and execution progress statistics, including the total number of customers, number of calls made, number of successful calls, number of failed calls, and other real-time data.
Prerequisites
-
An AccessKey has been obtained and configured. For more information, see Obtain an AccessKey and configure it as an environment variable.
-
The TaskId (task ID) has been obtained. You can obtain it from the response parameter Data.TaskId when calling CreateOutboundTask to create an outbound task, or by calling QueryOutboundTaskList to query the existing task list.
Request parameters
|
Name |
Type |
Required |
Description |
Example value |
|
Action |
String |
Yes |
The operation to perform. Set the value to QueryOutboundTaskDetail. |
QueryOutboundTaskDetail |
|
Version |
String |
Yes |
The API version number. Format: YYYY-MM-DD. Set the value to 2025-11-27. |
Fixed to 2025-11-27 |
|
TaskId |
Number |
Yes |
The task ID. |
1 |
Response parameters
|
Name |
Type |
Description |
Example value |
|
RequestId |
String |
The request ID. |
xxxx-xxxx-xxxx |
|
Success |
Boolean |
Indicates whether the request was successful. |
True |
|
Code |
String |
The error code. Empty when the request is successful. |
None |
|
Message |
String |
The error message or success message. |
Operation succeeded |
|
Data |
Object |
The response data, including fields such as TaskId, TaskName, SceneId, SceneName, CustomerListId, CustomerListName, TaskStatus, Concurrency, StartDate, EndDate, StartTime, EndTime, TaskDesc, TotalCustomers, CalledCount, SuccessCount, FailedCount, GmtCreate, and GmtModified. For more information, see the Data node parameter descriptions below. |
Examples
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="QueryOutboundTaskDetail",
method="POST",
pathname="/",
protocol="HTTPS",
auth_type="AK",
req_body_type="json",
body_type="json",
)
body = {'TaskId': 1}
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"Call failed: {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 {
// Initialize configuration
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);
// Set API parameters
Params params = new Params()
.setStyle("RPC")
.setVersion("2025-11-27")
.setAction("QueryOutboundTaskDetail")
.setMethod("POST")
.setPathname("/")
.setProtocol("HTTPS")
.setAuthType("AK")
.setReqBodyType("json")
.setBodyType("json");
// Build request parameters
Map<String, Object> body = new HashMap<>();
body.put("TaskId", 1);
OpenApiRequest request = new OpenApiRequest()
.setQuery(com.aliyun.openapiutil.Client.query(body));
// Set runtime options (auto-retry)
RuntimeOptions runtime = new RuntimeOptions()
.setAutoretry(true)
.setMaxAttempts(3);
try {
// Call the 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("Call failed: " + e.getMessage());
}
}
}
Sample response
{
"Success": true,
"Code": null,
"Message": "Operation succeeded",
"RequestId": "xxxx-xxxx-xxxx",
"Data": {
"TaskId": 1,
"TaskName": "Spring Festival promotion outbound task",
"SceneId": 100,
"SceneName": "Promotion notification scenario",
"CustomerListId": 200,
"CustomerListName": "VIP customer list",
"TaskStatus": "RUNNING",
"Concurrency": 10,
"StartDate": "2025-01-15",
"EndDate": "2025-01-31",
"StartTime": "09:00",
"EndTime": "18:00",
"TaskDesc": "Outbound calls for the Spring Festival promotion",
"TotalCustomers": 1000,
"CalledCount": 500,
"SuccessCount": 300,
"FailedCount": 200,
"GmtCreate": "2025-01-10 10:00:00",
"GmtModified": "2025-01-15 14:30:00"
}
}
The detailed results are returned in the Data node. The following table describes the parameters in the Data node.
|
Name |
Type |
Description |
Example value |
|
TaskId |
Number |
The task ID. |
1 |
|
TaskName |
String |
The task name. |
Spring Festival promotion outbound task |
|
SceneId |
Number |
The scenario ID. |
100 |
|
SceneName |
String |
The scenario name. |
Promotion notification scenario |
|
CustomerListId |
Number |
The customer list ID. |
200 |
|
CustomerListName |
String |
The customer list name. |
VIP customer list |
|
TaskStatus |
String |
The task status. |
RUNNING |
|
Concurrency |
Number |
The number of concurrent calls. |
10 |
|
StartDate |
String |
The start date. |
2025-01-15 |
|
EndDate |
String |
The end date. |
2025-01-31 |
|
StartTime |
String |
The daily start time. |
09:00 |
|
EndTime |
String |
The daily end time. |
18:00 |
|
TaskDesc |
String |
The task description. |
Outbound calls for the Spring Festival promotion |
|
TotalCustomers |
Number |
The total number of customers. |
1000 |
|
CalledCount |
Number |
The number of calls made. |
500 |
|
SuccessCount |
Number |
The number of successful calls. |
300 |
|
FailedCount |
Number |
The number of failed calls. |
200 |
|
GmtCreate |
String |
The creation time. |
2025-01-10 10:00:00 |
|
GmtModified |
String |
The last modification time. |
2025-01-15 14:30:00 |
Error information
If an error occurs, see Error codes for troubleshooting.