tencent cloud

Mobile Live Video Broadcasting

Release Notes and Announcements
TUILiveKit Release Notes
Live SDK Release Notes
User Guide
Product Introduction
Overview
Strengths
Performance Statistics
Concepts
Purchase Guide
TRTC Live Billing Overview
Billing of Video Live Component
Activating the Service (TUILiveKit)
Free Demo
Demo
Run Demo(TUILiveKit)
Integration Guide
Video Live Streaming
Preparation
Host Live Streaming
Audience Viewing
Live Stream List Live Stream List
Voice Chat Room
Preparation
Host Live Streaming
Audience Viewing
Live Stream List
Live Streaming Kit
Live Streaming Kit(Electron Desktop Application)
Live Streaming Kit(Web Desktop Browser)
Live Broadcast Monitoring
Monitoring Webpage (Web Desktop Browser React)
Monitoring Webpage (Web Desktop Browser Vue)
UI Customization
Live Stream Video Component
Video Source Editing Canvas
Audience List Component
Barrage Component
Media Source Configuration Panel
Link Management Panel
Live Gift Component
No UI Integration
Video Live Streaming
Voice Chat Room
Feature Guide
Follow Anchors (TUILiveKit)
Ultimate Image Quality (TUILiveKit)
Push Media Stream Into Room (TUILiveKit)
Gift System (TUILiveKit)
Client APIs
Android
iOS
Web
Server APIs (TUILiveKit)
Account System
REST API
Third-Party Webhooks
Error Codes (TUILiveKit)
FAQs
Platform Compilation
User Authentication
Live SDK
Product Introduction
Purchase Guide
Free Demo
Free Trial License
SDK Download
Licenses
Advanced Features
Client API
FAQs
Integration (No UI)
API Documentation
OSS information
OSS Attribution Notice

Send Custom Message

PDF
フォーカスモード
フォントサイズ
最終更新日: 2026-03-11 13:32:47

Feature Description

The App admin can use this API to send custom messages via this interface.

API Call Description

Sample Request URL

https://xxxxxx/v4/live_engine_http_srv/send_custom_msg?sdkappid=88888888&identifier=admin&usersig=xxx&random=99999999&contenttype=json

Request Parameters

The following table lists only the parameters involved in modification when calling this API and their descriptions. For more details about the parameters, please refer to REST API introduction.
Parameter
Description
xxxxxx
SDKAppID's dedicated domain name where it is located:
China: console.tim.qq.com
Singapore: adminapisgp.im.qcloud.com
United States: adminapiusa.im.qcloud.com
v4/live_engine_http_srv/send_custom_msg
Request API
sdkappid
The SDKAppID assigned by the Chat console when creating an application can be obtained from the application card in the Console of Chat.
identifier
Must be an application admin account. For more details, see the documentation Application Administrator.
usersig
The signature generated by the application admin account. For specific operations, see Generate UserSig.
random
Enter a random 32-bit unsigned integer, value ranges from 0 to 4294967295.
contenttype
Request format, the value is fixed as json.

Maximum Calling Frequency

200 times/second。

Sample Request Packet

Basic form

{
"RoomId":"room1",
"Sender_Account":"user1",
"BusinessId":"xxxxx",
"Data":"zzzzzzz"
}



Request Packet Fields

Field
Type
Attribute
Description
RoomId
String
Required
Room ID.
Sender_Account
String
Optional
Message sender.
BusinessId
String
Required
Mark of message.
Data
Integer
Required
Message content.

Message Format Description

This endpoint is a wrapper for standard Chat group messages. The MsgBody in the request body follows the custom message format. The wrapped request structure is as follows:
{
"MsgBody" : [
{
"MsgContent" : {
"Data" : "{\\"BusinessId\\":\\"key\\",\\"Data\\":\\"value\\"}"
},
"MsgType" : "TIMCustomElem"
}
}

Data: A JSON string composed of the BusinessId and Data fields from the original message request.
Callback Integration
This request information is utilized in message callbacks. For detailed descriptions, please refer to the Before a Group Message Is Sent and After a Group Message Is Sent documentation.

Response Package Example


{
"ErrorCode": 0,
"ErrorInfo": "",
"ActionStatus": "OK",
"RequestId": "Id-b6454678e8a647ffa476ec1fee1263d1-O-Seq-2433991",
"Response": {
"MsgTime": 1750074537,
"MsgSeq": 26,
"MsgDropReason" : "MsgFreqCtrl"
}
}


Response Packet Fields

Field
Type
Description
ActionStatus
String
Request processing result.
OK: processing successful.
FAIL: processing failed.
ErrorCode
Integer
Error Code.
0: success.
Non-zero: Indicates Failure.
ErrorInfo
String
Error message.
RequestId
String
Unique request ID, returned for each request. To locate a problem, the RequestId of the request should be provided.
MsgTime
Integer
Message sending timestamp, corresponding to the backend server time.
MsgSeq
Integer
Message sequence number, the unique identifier of a message.
MsgDropReason
String
Reason for discarding the message. It is empty by default. Currently, only messages that exceed the frequency limit are discarded.

Error Code Description

Unless a network error (such as 502) occurs, the HTTP return code of this API is 200. The actual error code and error information are indicated by ErrorCode and ErrorInfo in the response payload.
Common error codes (60000 to 79999), please refer to the Error Code document.
Private error codes of this API are as follows:
Error Code
Description
100001
Server internal error, please try again.
100002
Invalid parameter. Check whether the request is correct according to the error description.
100004
The room does not exist, possibly because it was never created or has already been dissolved.
100006
Indicates that this room is not a live room and does not have permission to use live query interfaces.
100601
The message cannot be sent due to muting. Check whether the sender is muted.
100602
The frequency limit for message sending is reached. Try again later.
100603
The message content is too long. Currently, the maximum message length supported is 12 KB. Please adjust the message length.


ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック