tencent cloud

Cloud Contact Center

Announcement
What's New
Cloud Contact Center Terminology Update
What is Tencent Cloud Contact Center
Overview
Feature List
Terms Introduction
Handling Firewall Restrictions
AI Voicebot
Billing Guide
Voice Call Billing Overview
Desk Billing Overview
View Billing
Refund Policy
New User Guide
Voice Guide
Desk Guide
Use Case
Inbound: Customer Experience
Outbound: Telemarketing
Auto Dialer: Voice Notification
Integration Use Case (SDK)
Administrator Guide
Voice Guide
Desk Guide
Member Guide
Voice Guide
Desk Guide
AI Voice Agent Guide
Introducing AI Voice Agent
AI Voice Agent Practical Tutorial
Set Up Your AI Voice Agent
Activate AI Voice Agent Call
AI Voice Agent Call Logs
Developer Guide
SDK Development Guide
Data Push
Voice API Reference
History
Introduction
API Category
Making API Requests
Agent APIs
Skill Group APIs
Number APIs
Dual Call APIs
Predictive Outbound Call APIs
SIP Phone APIs
Call Service Record APIs
Billing APIs
Other APIs
Outbound Call APIs
Speech Intelligent Agent APIs
Data Types
Error Codes
Desk API Reference
API Reference
Callback Configuration
FAQs
Data Deletion Guide
Legal
Privacy Policy
Data Processing And Security Agreement
Service Level Agreements
TENCENT CLOUD CONTACT CENTRE TERMS OF USE
Glossary
Contact Us

Sending Stream Messages

Mode fokus
Ukuran font
Terakhir diperbarui: 2025-04-07 11:23:20

API Call Description

App admins can use this API to send streaming messages to users. After being transferred to a human customer service, the agent can also see the message.

Sample Request URL

https://console.tim.qq.com/v4/desk_http_svc/send_stream_msg?sdkappid=88888888&identifier=admin&usersig=xxx&random=99999999&contenttype=json

Request Parameters

The following table only lists the parameters involved in modification when calling this API and their descriptions. For more details about the parameters, please see REST API Introduction.
Parameter
Description
v4/desk_http_svc/send_stream_msg
Request API
sdkappid
Assigned SDKAppID in the Chat console when creating an application
identifier
Must be an App administrator account. For more details, see App Administrator.
usersig
Generated signature of the App administrator account. For specific operations, see Generate UserSig.
random
Enter a random 32-bit unsigned integer. The value ranges from 0 to 4294967295.
contenttype
The request format has a fixed value of json.

Sample Request Packet

First invocation
{
"SessionId": "fd8a2e30-54de-4e40-bcaf-02718409c5cf", //Identification ID of the session
"Chunk": "Hello, " // Message content.
}
First response
"ActionStatus": "OK", "ErrorInfo": "", "ErrorCode": 0, "MsgKey": "124_1600045926_716f784b2bbd6ce9415027715" //Message identifier returned. This parameter needs to be transmitted in subsequent calls. }
Append text for subsequent call
{
"SessionId": "fd8a2e30-54de-4e40-bcaf-02718409c5cf",
"Chunk": "this is ",
"MsgKey": "124_1600045926_716f784b2bbd6ce9415027715"
}
Last call:
{
"SessionId": "fd8a2e30-54de-4e40-bcaf-02718409c5cf",
"Chunk": "Tencent Cloud.",
"MsgKey": "124_1600045926_716f784b2bbd6ce9415027715",
Finish: 1 //This field is 1, indicating the end of streaming messages.
}

Request Packet Fields

Field
Type
Required
Description
SessionId
String
Required
Conversation ID
Chunk
String
Required
Message content
MsgKey
String
Optional.
Not required for the first API call, but needs to be filled in starting from the second call.
Finish
Integer
Optional.
When calling for the last time, this field is 1, indicating that the streaming output has stopped.

Response Package Example

{
"ActionStatus": "OK",
"ErrorInfo": "",
"ErrorCode": 0
}

Response Packet Fields

Field
Type
Description
ErrorCode
Integer
Error Code:
0: success
Non-zero: failure
ErrorInfo
String
Error message.
ActionStatus
String
Result of request processing
MsgKey
String
Return the unique message identifier for subsequent text output.

Error Code Description

Unless a network error (for example, 502 error) occurs, the HTTP return code of this API is always 200. The actual error code and error information are represented by ErrorCode and ErrorInfo in the response packet body. For common error codes (60000 to 79999), please refer to the Error Code document. The private error codes of this API are as follows:
Error Code
Description
20001
Invalid request packet
20002
UserSig or A2 invalid
20003
The UserID of the sender or recipient is invalid or does not exist. Please check whether the UserID has been imported into IM.
20004
Network issue, please retry.
20005
Internal server error, please retry.
20006
Trigger the callback before sending a private chat message, and the App backend returns that the message cannot be delivered.
90001
JSON format parsing failed. Check whether the request package conforms to the JSON Specification.
90002
The MsgBody in the JSON format request packet does not match the message format description, or the MsgBody is not an Array type. See the definition of TIMMsgElement object.
90005
The JSON format request body lacks the MsgRandom field or the MsgRandom field is not of the Integer type.
90007
The MsgBody type in the JSON format request body is not an Array type. Change it to an Array type.
90009
Request requires App administrator permissions.
90010
The JSON format request packet does not match the message format description. See the definition of TIMMsgElement object.
93000
The JSON data packet is excessively long. The message body should not exceed 12k.
141000
Applications other than Desk are not allowed to call this API.
141002
Internal system error, please retry.
141004
Illegal request parameters, please check and retry.
141005
This session does not exist.
141006
Illegal SessionID

API Debugging Tool

Debug this interface using the REST API online debugging tool.

Bantuan dan Dukungan

Apakah halaman ini membantu?

masukan