Send Gift
Feature Description
The App admin can use this API to send a gift.
API Call Description
Sample Request URL
https://xxxxxx/v4/live_engine_http_srv/send_gift?sdkappid=88888888&identifier=admin&usersig=xxx&random=99999999&contenttype=json
Request Parameters
The following table lists only the parameters involved in modification and their descriptions when calling this API. For more details about the parameters, please refer to REST API Introduction.
Parameter | Description |
xxxxxx | SDKAppID is located in the dedicated domain name for the country/region. China: console.tim.qq.comSingapore: adminapisgp.im.qcloud.comUnited States: adminapiusa.im.qcloud.com |
v4/live_engine_http_srv/send_gift | Create live streaming room 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 | |
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": "room_id","GiftId": "gift1","Count": 1,"From_Account": "user1","ReceiverList_Account": ["user2"]}
Request Packet Fields
Field | Type | Attribute | Description |
RoomId | String | Required | room ID |
GiftId | String | Required | Gift ID must be already passed gift configuration API configuration |
From_Account | String | Required | Gift Sender |
ReceiverList_Account | Array | Required | Gift Recipient |
Sample Response Packet Body
Basic form
{"ActionStatus": "OK","ErrorInfo": "","ErrorCode": 0,"RequestId": "Id-8c9858f01e954611ae2d4c1b1ed7d583-O-Seq-52720"}
Response Packet Fields
Field | Type | Description |
ActionStatus | String | Request processing result. OK: processing successful. FAIL: processing failed. |
ErrorCode | Integer | Error Code. 0: indicates success. Non-zero: indicates failure. |
ErrorInfo | String | Error message. |
RequestId | String | Unique request ID, returned for each request. To troubleshoot a request, its RequestId should be provided. |
Error Code Description
Unless a network error (such as 502 error) 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.
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. |
100003 | The room ID already exists. Please select another room ID. |
102001 | Gift power not enabled. Please check the paid plan. |
102002 | The gift ID does not exist. |
102004 | Gift callback failed. |
102008 | Gift switch in current room not enabled. |