logo
On this page

Report live comment-based game information


Description

This callback allows you to receive specific event notifications when the live comment-based game starts and when the live comment-based game is finished.

Callback description

  • Request methods: POST.
  • Callback address: Contact the ZEGOCLOUD technical support team to configure the callback address.
  • Transmission protocol: HTTPS.

Callback parameters

Common parameterTypeDescription
AppIdInt64The unique ID of the application.
SignatureNonceStringA random number.
TimestampInt64Unix The UNIX timestamp. Unit: seconds.
SignatureStringSignature.
Business parameterTypeDescription
GameSourceStringThe game source, fixed as zego.
ReportIdStringGenerated by ZEGOCLOUD, unique callback ID under the same MiniGameId.
ReportTypeIntReport information types:
  • 1: Game starts.
  • 2: Game settlement.
MiniGameIdStringThe game ID.
RoomIdStringThe game room ID.
AnchorIdStringThe ID of the game room owner.
RoundIdStringThe game session identifier is generated by the ZEGOCLOUD server and is unique within the same MiniGameId.
ReportTimeInt64The time when the event occurs. The time is a UNIX timestamp. Unit: milliseconds.
DanmakuResultObjectGame settlement information. Only reported at game settlement.
WinTeamIntWinning team of the live comment-based game.
ResultTypeIntSettlement types:
  • 0:Normal ending.
  • 1:Ended by the anchor.
  • 2:Ended due to timeout.
  • 3:Escape.
  • 4:Game forcefully closed.
  • 5: Game ended due to an exception.
UserSizeIntNumber of participating users.
ExtraDataStringAdditional JSON data.

Callback example

Untitled
{
    "AppId":1234567890,
    "SignatureNonce":"15215528852396",
    "Timestamp":1234567890,
    "Signature":"Pc5WB8gokVn0xfeu%2FZV%2BiNM1dgI%3D",
    "GameSource":"zego",
    "ReportId":"jjjjjj",
    "MiniGameId":"aaaaaa",    
    "ReportType":2,
    "RoomId":"abcd",
    "AnchorId":"user111",
    "RoundId":"xxx",
    "ReportTime":1662365592,
    "DanmakuResult":{
        "WinTeam":"1",
        "ResultType":1,
        "UserSize":10,
        "ExtraData":""
    }    
}
1
Copied!

Response parameters

Please respond after receiving this callback, the parameters are shown in the following table:

ParameterTypeIs it requiredDescription
CodeInt64YesThe HTTP status code. Valid values:
  • 200:The callback succeeds.
  • 401、404、500:The callback fails.
MessageStringNoThe response message.

Response Example

Untitled
{
    "Code": 200,
    "Message": "succeed"
}
1
Copied!

Previous

Check gift sending results

Next

Global return codes