Upload business knowledge (UploadOutboundSceneKnowledge)
Upload business knowledge content for a specified outbound scenario. The uploaded knowledge will be used for AI script enhancement and intelligent Q&A, improving the professionalism and accuracy of outbound call conversations.
Prerequisites
-
The SDK is installed.
-
An AccessKey has been obtained and configured. For more information, see Obtain an AccessKey and configure it as an environment variable.
-
The SceneId (scenario ID) has been obtained. You can obtain it from the Data.SceneId parameter in the response when calling CreateOutboundScene to create an outbound scenario, or by calling QueryOutboundSceneList to query the list of existing scenarios.
Request parameters
|
Name |
Type |
Required |
Description |
Example |
|
Action |
String |
Yes |
The operation to perform. Set the value to UploadOutboundSceneKnowledge. |
UploadOutboundSceneKnowledge |
|
Version |
String |
Yes |
The API version number. The format is YYYY-MM-DD. Set the value to 2025-11-27. |
Fixed to 2025-11-27 |
|
SceneId |
Number |
Yes |
The scenario ID. |
1 |
|
KnowledgeContent |
String |
Yes |
The knowledge content. |
Our company specializes in intelligent customer service systems |
Response parameters
|
Name |
Type |
Description |
Example |
|
RequestId |
String |
The request ID. |
xxxx-xxxx-xxxx |
|
Success |
Boolean |
Indicates whether the request was successful. |
True |
|
Code |
String |
The error code. This parameter is empty when the request is successful. |
None |
|
Message |
String |
The error message or success message. |
Operation succeeded |
|
Data |
Object |
The returned data, which includes fields such as Success. For more information, see the response parameter description 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="UploadOutboundSceneKnowledge",
method="POST",
pathname="/",
protocol="HTTPS",
auth_type="AK",
req_body_type="json",
body_type="json",
)
body = {'SceneId': 1, 'KnowledgeContent': 'Our company specializes in intelligent customer service systems'}
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("UploadOutboundSceneKnowledge")
.setMethod("POST")
.setPathname("/")
.setProtocol("HTTPS")
.setAuthType("AK")
.setReqBodyType("json")
.setBodyType("json");
// Build request parameters
Map<String, Object> body = new HashMap<>();
body.put("SceneId", 1);
body.put("KnowledgeContent", "\u793a\u4f8b\u503c");
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": {
"Success": true
}
}
The specific processing result is in the Data node. The following table describes the parameters in the Data node.
|
Name |
Type |
Description |
Example |
|
Success |
Boolean |
Indicates whether the operation was successful. |
True |
Error information
If an error occurs during execution, see Error codes for troubleshooting.