GetVocab - 获取热词

根据词表的ID获取对应的词表信息。

接口说明

请确保在使用该接口前,已充分了解通义晓蜜 CCAI-对话分析 AIO 产品的收费方式和价格。

前提条件

  • 已开通通义晓蜜 CCAI-对话分析 AIO 服务。
  • 已创建应用:应用中心完成通义晓蜜 CCAI-对话分析 AIO 应用创建,并获取到 APP-ID 和 WORKSPACE-ID:获取 APP-ID 和 WORKSPACE-ID

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息

当前API暂无授权信息透出。

请求语法

POST /vocab/getVocab HTTP/1.1

请求参数

名称类型必填描述示例值
bodyobject

请求 Body

vocabularyIdstring

热词 id

dhbf***rbrdb
workspaceIdstring

工作空间 ID

llm-9864***1

请求代码示例


import com.alibaba.fastjson.JSONObject;
import com.aliyun.contactcenterai20240603.Client;
import com.aliyun.contactcenterai20240603.models.CreateVocabRequest;
import com.aliyun.contactcenterai20240603.models.CreateVocabResponse;
import com.aliyun.contactcenterai20240603.models.GetVocabRequest;
import com.aliyun.contactcenterai20240603.models.GetVocabResponse;
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);

        GetVocabRequest request = new GetVocabRequest();
        request.setVocabularyId("1a3188**********7d2e");
        request.setWorkspaceId(workspaceId);

        GetVocabResponse response = client.getVocab(request);
        System.out.println(JSONObject.toJSONString(response));
    }
}

返回参数

名称类型描述示例值
object

Schema of Response

requestIdstring

请求 id

968A8634-FA2C-5381-9B3E-*******F
successstring

请求是否成功

true
dataobject

返回数据

vocabularyIdstring

热词 id

rrbe***jrvrdd
namestring

名称

热词1
descriptionstring

描述

销售热词
audioModelCodestring

语音转写模型

nls
wordWeightListarray<object>

热词组

wordWeightListobject

热词组

wordstring

单词

儿童
weightinteger

权重

1

示例

正常返回示例

JSON格式

{
  "requestId": "968A8634-FA2C-5381-9B3E-*******F",
  "success": "true",
  "data": {
    "vocabularyId": "rrbe***jrvrdd",
    "name": "热词1",
    "description": "销售热词",
    "audioModelCode": "nls",
    "wordWeightList": [
      {
        "word": "儿童",
        "weight": 1
      }
    ]
  }
}

错误码

HTTP status code错误码错误信息描述
400CCAI.InvalidParam.NotExistThe specified parameter %s is not valid.请求API的参数不存在
400CCAI.ParamInvalid.IllegalParamValueThe parameter value of the request API is illegal %s.请求API的参数不合法
400CCAI.Throttling.QpmTrigger QPM flow restriction. Please purchase higher QPM for paid API. If free API has special requirements, please contact us through DingTalk group (62730018475).触发QPM限流,付费API请购买更高QPM,免费API如有特殊需求,请通过钉钉群(62730018475)联系我们。
400CCAI.Throttling.QpsTrigger 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).触发限流,付费API请购买更高QPS,免费API如有特殊需求,请通过钉钉群(62730018475)联系我们。
403CCAI.IllegalPermission.NoAuthUser not authorized to operate on the specified resource.该用户未被授权可操作指定资源
403CCAI.ParamNotfound.MissParamParameter verification failed, The specified parameter %s is missing.参数校验失败,指定参数缺失。
403CCAI.TenantPermission.NoAuthThe current account does not have the permission to specify the business space. Please authorize the business space permission.当前账号没有指定业务空间的权限,请进行业务空间权限授权。
500CCAI.InternalErrorThe request processing has failed due to some unknown error, exception or failure.系统内部错误,请稍后重试

访问错误中心查看更多错误码。