logo
On this page

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.

ParametersTypeIs it requiredDescription
RoomIdStringYesRoom ID, defined by you, can be up to 64 characters long.
MiniGameIdStringYesTo obtain a game ID, please contact the ZEGOCLOUD technical support team.
LikeListArray of ObjectYesIntegrated likes list.
UserInfoObjectYesUser information object.
UserIdStringYesUser ID to participate in the game, defined by you, maximum length is 48 characters, only numbers and English are allowed.
NicknameStringYesUser nickname, defined by you, can be up to 32 characters in length.
AvatarStringYesThe address of the user's avatar must be a valid HTTP/HTTPS address and the length must be within 1024 bytes.
SexStringNoUser gender.
  • 1:Male.
  • 2:Female.
AmountNumberNoThe number of likes for this user, defaults to 1.

Request example

  • Request URL

    Untitled
    https://mini-game-api.zego.im/?Action=SendDanmakuLikes
    &<Common request parameters>
    
    1
    Copied!
  • 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
    Copied!

Response parameters

ParameterTypeDescription
CodeNumberError code.
MessageStringDescription of the request result.
RequestIdStringRequest ID.

Response example

Untitled
{
    "Code": 0,
    "Message": "succeed",
    "RequestId": "abcd123",
}
1
Copied!

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 codeDescriptionHandling suggestions
 7202001 The game was not found. Possible reasons include:
  • MiniGameId input error.
  • Permissions for this game have not been activated.
  • Please check whether the MiniGameId is correct.
  • Please contact ZEGOCLOUD business personnel to activate the permission for this game.
 7202002 MiniGameId format error.Please confirm whether the format is String.

Previous

Obtain a game start code

Next

Send comments