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

https://write.woa.com/document/197178749187870720

PDF
フォーカスモード
フォントサイズ
最終更新日: 2026-03-11 14:35:40

Feature Description

The App backend can use the callback to determine whether to pass the gift-sending verification in other scenarios.

Precautions

Enable callback Configure callback URL and turn on the switch corresponding to this callback. For the configuration method, see Callback Configuration.
The callback direction is from the Live backend to the App backend via an HTTP POST request.
After receiving a callback request, the App backend needs to verify whether the value of the SDKAppID parameter in the request URL is its own SDKAppID.

Callback Triggering Scenarios

App user sends a gift through the client

Callback Triggering Timing

Before sending a gift.

API Description

Sample Request URL

In the following example, the callback URL configured for the App is https://www.example.com.
Example:
https://www.example.com?SdkAppid=$SDKAppID&CallbackCommand=$CallbackCommand&contenttype=json&ClientIP=$ClientIP&OptPlatform=$OptPlatform

Request Parameters

Parameter
Description
https
The request protocol is HTTPS, and the request method is POST.
www.example.com
Callback URL.
SdkAppid
The SDKAppID assigned in the Chat console when creating an application.
CallbackCommand
Fixed as Live.CallbackBeforeSendGift.
contenttype
The value is fixed as json.
ClientIP
Client IP address in the format of 127.0.0.1.
OptPlatform
Client platform. For the valid values, see the description of the OptPlatform parameter in Webhook Protocol in Webhook Overview.

Sample Request Packet

{
"CallbackCommand": "Live.CallbackBeforeSendGift",
"Operator_Account": "brennanli",
"RoomId":"room_id",
"GiftWater": {
"From_Account": "from",
"To_Account": ["to1"],
"Time": 1703589922,
"GiftId": "gift1",
"Count": 1,
"Coins": 1000
}
}

Request Packet Fields

Field
Type
Description
CallbackCommand
String
callback command.
Operator_Account
String
Operator UserID who triggered the battle request.
RoomId
String
room ID.
From_Account
String
gift sender.
To_Account
Array
gift recipient.
Time
Integer
Timestamp.
GiftId
String
gift ID.
Count
Integer
gift number.
Coins
Integer
gift value.

Sample Response Packet

The callback response packet is sent after the App backend synchronizes the data.
{
"ActionStatus": "OK",
"ErrorInfo": "",
"ErrorCode": 0
}
If the App needs to block gift sending, set the response packet ErrorCode to non-zero. If the live backend does not receive the response packet within 2s, gift sending will also be blocked by default.
If the App needs the gift sending non-blocking scenario (if the response packet fails to reply or the live backend does not return the response packet within 2s, it will allow at this point), you can set the pre-gift callback non-blocking configuration.

Response Packet Fields

Field
Type
Attribute
Description
ActionStatus
String
Required
Request processing result. OK: processing successful; FAIL: processing failed.
ErrorCode
Integer
Required
0 means agree, 1 means Reject. The error code interval that can be passed through is [102100,102200].
ErrorInfo
String
Required
Error Message.

References

ヘルプとサポート

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

フィードバック