UpdateVocab
Updates a vocabulary's information based on its ID, including its name, description, words, and weights.
Operation description
Before using this operation, you must understand the billing methods and pricing of the Tongyi Xiaomi Contact Center AI (CCAI)-Conversation Analysis AIO product.
Prerequisites
- You have activated the Tongyi Xiaomi CCAI-Conversation Analysis AIO service.
- You have created an application: Create a Tongyi Xiaomi CCAI-Conversation Analysis AIO application in the Application Center and obtain your APP-ID and WORKSPACE-ID: Obtain APP-ID and WORKSPACE-ID.
Try it now
You can run this API directly in OpenAPI Explorer without worrying about calculating signatures. After a successful run, OpenAPI Explorer can automatically generate SDK code examples.
RAM authorization
No authorization information is available for the current API.
Request syntax
POST /vocab/updateVocab HTTP/1.1
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| body | object | No | The request body. | |
| vocabularyId | string | Yes | The vocabulary ID. | dsvsv***dsvv |
| name | string | No | The name. | Hot word 1 |
| description | string | No | The description. | Sales hot words |
| wordWeightList | array<object> | No | The hot word group. | |
| object | No | A hot word group. | ||
| word | string | Yes | The word. | Hongqiao |
| weight | integer | Yes | The weight. | 2 |
| workspaceId | string | Yes | The workspace ID. | llm-jhfr****w8v |
Request example
import com.alibaba.fastjson.JSONObject;
import com.aliyun.contactcenterai20240603.Client;
import com.aliyun.contactcenterai20240603.models.*;
import com.aliyun.teaopenapi.models.Config;
import java.util.ArrayList;
import java.util.List;
public class Vocab {
private static String accessKeyId = "YOUR_ACCESS_KEY_ID";
private static String accessKeySecret = "YOUR_ACCESS_KEY_SECRET";
private static String workspaceId = "YOUR_WORKSPACE_ID";
private static Config config = new Config();
static {
config.setAccessKeyId(accessKeyId).setAccessKeySecret(accessKeySecret).setEndpoint("contactcenterai.cn-shanghai.aliyuncs.com")
.setReadTimeout(30000).setConnectTimeout(300000).setRegionId("cn-shanghai").setProtocol("HTTPS");
}
public static void main(String[] args) throws Exception {
Client client = new Client(config);
UpdateVocabRequest request = new UpdateVocabRequest();
request.setVocabularyId("f3d82e0d********d23bd7");
request.setName("Sales hot words");
request.setDescription("Sales hot words for South China 1");
request.setWorkspaceId(workspaceId);
List<UpdateVocabRequest.UpdateVocabRequestWordWeightList> wordWeightList = new ArrayList<>();
UpdateVocabRequest.UpdateVocabRequestWordWeightList word1 = new UpdateVocabRequest.UpdateVocabRequestWordWeightList();
word1.setWord("Europe");
word1.setWeight(4);
wordWeightList.add(word1);
UpdateVocabRequest.UpdateVocabRequestWordWeightList word2 = new UpdateVocabRequest.UpdateVocabRequestWordWeightList();
word2.setWord("Earache");
word2.setWeight(2);
wordWeightList.add(word2);
request.setWordWeightList(wordWeightList);
UpdateVocabResponse response = client.updateVocab(request);
System.out.println(JSONObject.toJSONString(response));
}
}
Response elements
| Element | Type | Description | Example |
|---|---|---|---|
| object | Schema of Response | ||
| requestId | string | The request ID. | 968A8634-FA2C-5381-9B3E-*******F |
| success | string | Indicates whether the request was successful. | true |
| data | string | The data returned. | true |
Examples
Success response
JSON format
{
"requestId": "968A8634-FA2C-5381-9B3E-*******F",
"success": true,
"data": true
}
Error codes
| HTTP status code | Error code | Error message | Description |
|---|---|---|---|
| 400 | CCAI.InvalidParam.NotExist | The specified parameter %s is not valid. | The request parameter does not exist. |
| 400 | CCAI.ParamInvalid.IllegalParamValue | The parameter value of the request API is illegal %s. | The parameter value of the request API is illegal. |
| 400 | CCAI.Throttling.Qpm | Trigger QPM flow restriction. Please purchase higher QPM for paid API. If free API has special requirements, please contact us through DingTalk group (62730018475). | QPM throttling is triggered. Purchase a higher QPM for paid APIs. If you have special requirements for free APIs, contact us through the DingTalk group (62730018475). |
| 400 | CCAI.Throttling.Qps | Trigger current QPS limit, pay API please buy higher QPS, the free API if you have special requirements, please contact us through the DingTalk group (62730018475). | Throttling is triggered. Purchase a higher QPS for paid APIs. If you have special requirements for free APIs, contact us through the DingTalk group (62730018475). |
| 403 | CCAI.IllegalPermission.NoAuth | User not authorized to operate on the specified resource. | The user is not authorized to operate on the specified resource. |
| 403 | CCAI.ParamNotfound.MissParam | Parameter verification failed, The specified parameter %s is missing. | Parameter validation failed. The specified parameter is missing. |
| 403 | CCAI.TenantPermission.NoAuth | The current account does not have the permission to specify the business space. Please authorize the business space permission. | The current account does not have permission to access the specified workspace. Grant workspace permissions as needed. |
| 500 | CCAI.InternalError | The request processing has failed due to some unknown error, exception or failure. | Internal system error. Try again later. |
Visit the Error Center to view more error codes.