Send likes
Description
Calling this interface triggers a like event within the bullet screen game, which will generate corresponding effects in the live comment-based game client.
Note
- The game platform will try its best to ensure the effectiveness of likes.
- If a user has not joined the game, their like will be discarded.
- Please merge the user's like messages at the room level before requesting this interface, and it is recommended to integrate the user's like information every 50-200ms.
Request method and endpoint
- Request method: POST
- Request URL:
https://mini-game-api.zego.im/?Action=SendDanmakuLikes
- Transmission protocol: HTTPS
- Call frequency limit: 100 times/second (at the room level)
Request parameters
The following request parameter list only lists interface request parameters. For the public parameter list, please refer to Make API requests.
Parameters | Type | Is it required | Description |
---|---|---|---|
RoomId | String | Yes | Room ID, defined by you, can be up to 64 characters long. |
MiniGameId | String | Yes | To obtain a game ID, please contact the ZEGOCLOUD technical support team. |
LikeList | Array of Object | Yes | Integrated likes list. |
UserInfo | Object | Yes | User information object. |
UserId | String | Yes | User ID to participate in the game, defined by you, maximum length is 48 characters, only numbers and English are allowed. |
Nickname | String | Yes | User nickname, defined by you, can be up to 32 characters in length. |
Avatar | String | Yes | The address of the user's avatar must be a valid HTTP/HTTPS address and the length must be within 1024 bytes. |
Sex | String | No | User gender.
|
Amount | Number | No | The number of likes for this user, defaults to 1. |
Request example
-
Request URL
Untitledhttps://mini-game-api.zego.im/?Action=SendDanmakuLikes &<Common request parameters>
1 -
Request message body
Untitled{ "RoomId": "room123", "MiniGameId": "TinyLoveWar", "LikeList": [ { "UserInfo": { "UserId": "user1", "Nickname": "test1", "Avatar": "http://", "Sex": 1 }, "Amount": 10 }, { "UserInfo": { "UserId": "user2", "Nickname": "test2", "Avatar": "http://", "Sex": 1 }, "Amount": 10 } ] }
1
Response parameters
Parameter | Type | Description |
---|---|---|
Code | Number | Error code. |
Message | String | Description of the request result. |
RequestId | String | Request ID. |
Response example
Untitled
{
"Code": 0,
"Message": "succeed",
"RequestId": "abcd123",
}
1
Return code
The following only lists the return codes related to the interface business logic. For complete return codes, please refer to Global return codes.
Return code | Description | Handling suggestions |
---|---|---|
7202001 | The game was not found. Possible reasons include:
|
|
7202002 | MiniGameId format error. | Please confirm whether the format is String. |