logo
In-app Chat
On this page

Callback on room created


Overview

With this callback, you can receive the callback on the room created by the user in real time, and view the information of the room created by the user.

Callback description

  • Request method: POST.
    Note

    The callback data format is JSON, and you need to perform UrlDecode decoding on it.

  • Request URL: The corresponding callback endpoint set in the ZEGOCLOUD Admin Console
  • Protocol: HTTPS/HTTP. HTTPS is recommended.

Callback parameters

ParameterTypeDescription
appidStringThe unique identifier of the App.
eventStringThe callback event. The return value of this callback is group_create.
timestampIntThe server time in Unix timestamp when the group is created.
nonceStringA random number, used to calculate the signature.
signatureStringThe verification string. For details, see Authenticating server-to-server callbacks
ParametersTypeDescription
room_idStringRoom ID.
operator_accountStringThe user ID of the room creator.
room_nameStringRoom name.
attributesArray of ObjectThe attributes set when the room is created.
└ keyStringThe attribute Key.
└ valueStringThe attribute Value.
└ auto_deleteIntWhether the attribute will be automatically deleted when operator_account exits the room.
  • 0: (Default) No.
  • 1: Yes.
    Note
    If operator_account is not in the room, this parameter will be automatically deleted when it exits the room after entering the room.
Note

We recommend that you convert some parameters to Int for logical processing. The relevant fields include appid and nonce.

Sample code

Untitled
{
    "appid" : "1",
    "event" : "room_create",
    "room_id" : "1",
    "nonce": "350176",
    "signature": "signature",
    "operator_account" : "userA",
    "room_name" : "room_name",
    "attributes" : [
        {
            "key" : "UserSet1",
            "value" : "UserGet1",
            "auto_delete" : 0
        }
        {
            "key" : "UserSet2",
            "value" : "UserGet2",
            "auto_delete" : 0
        }
    ]
    "timestamp" : 1499676978
}
1
Copied!

Return codes

A status code of 2XX (such as 200) indicates success, and other responses indicate failure.

Callback retry policy

If the ZEGOCLOUD server does not receive a response, or the HTTP status code received by the ZEGOCLOUD server is not 2xx (such as 200), it will retry with intervals of 2s, 4s, 8s, 16s, and 32s respectively. If the retry still fails after an interval of 32s, it will no longer retry.

Previous

Login and logout

Next

Room entered