DescribeVoiceConversation
1. API Description
Domain name for API request: trtc.intl.tencentcloudapi.com.
After a conversation task starts successfully, use this API to query the conversation status. It can be used only while the conversation task is in progress. Querying after the conversation task exits returns an error.
A maximum of 20 requests can be initiated per second for this API.
2. Input Parameters
The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| Action | Yes | String | Common Params. The value used for this API: DescribeVoiceConversation. |
| Version | Yes | String | Common Params. The value used for this API: 2019-07-22. |
| Region | Yes | String | Common Params. For more information, please see the list of regions supported by the product. This API only supports: ap-guangzhou, ap-hongkong, ap-singapore. |
| SdkAppId | Yes | Integer | The TRTC SdkAppId. It must be the same SdkAppId as the conversation room. |
| TaskId | Yes | String | Unique ID of the conversation task. Returned when the conversation task starts successfully. |
| DescribeType | No | Integer | Whether to include the conversation history. Valid values: - 0: Do not include the conversation history. - 1: Include the conversation history. Default: 0 |
3. Output Parameters
| Parameter Name | Type | Description |
|---|---|---|
| StartTime | Integer | Task start time Unit: ms |
| Status | String | Conversation task status. Valid values: - Idle: The conversation task is idle.- InProgress: The conversation task is in progress.- Exited: The conversation task is exiting. |
| TaskId | String | Unique ID of the conversation task. |
| HistoryContents | Array of VoiceConversationHistoryContent | Conversation history. |
| RequestId | String | The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. |
4. Example
Example1 Querying a conversation task
Input Example
POST / HTTP/1.1
Host: trtc.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeVoiceConversation
<Common request parameters>
{
"SdkAppId": 1400000311,
"TaskId": "-nG0jIFU7rPr0tFW0cg282rOxP*************************bUA9JbOXgp3tnRyVJAzlBFAE.",
"DescribeType": 1
}Output Example
{
"Response": {
"HistoryContents": [
{
"Role": "user",
"Content": "How is the recent weather in Shanghai"
},
{
"Role": "assistant",
"Content": "I'm unable to access real-time weather data, so I cannot tell you the exact current weather in Shanghai. I recommend checking your phone's built-in weather app or a platform such as China Weather to get the latest forecast.\n\nIf you tell me the specific date, I can also describe Shanghai's typical climate during this season, including temperature ranges and precipitation, for your reference."
}
],
"StartTime": 1790081311564,
"Status": "InProgress",
"TaskId": "-nG0jIFU7rPr0tFW0cg282rOxP*************************bUA9JbOXgp3tnRyVJAzlBFAE.",
"RequestId": "ebb2213e-7322-4f9b-8fcd-60c08a5168b7"
}
}5. Developer Resources
SDK
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
- Tencent Cloud SDK 3.0 for Python
- Tencent Cloud SDK 3.0 for Java
- Tencent Cloud SDK 3.0 for PHP
- Tencent Cloud SDK 3.0 for Go
- Tencent Cloud SDK 3.0 for Node.js
- Tencent Cloud SDK 3.0 for .NET
- Tencent Cloud SDK 3.0 for C++
Command Line Interface
6. Error Code
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
| Error Code | Description |
|---|---|
| AuthFailure | CAM signature/authentication error. |
| AuthFailure.UnauthorizedOperation | CAM authentication failed. |
| AuthFailure.UnsupportedOperation | Unsupported operation. |
| FailedOperation | Operation failed. |
| InternalError | Internal error. |
| InvalidParameter | Parameter error. |
| InvalidParameter.SdkAppId | SdkAppId is incorrect. |
| MissingParameter | Missing parameter. |
| MissingParameter.RoomId | RoomId is missing. |
| MissingParameter.SdkAppId | SdkAppId is missing. |
| MissingParameter.TaskId | TaskId parameter is missing. |
| MissingParameter.UserId | Missing UserId parameter. |
| ResourceNotFound | The resource does not exist. |
