RoomKit
  • iOS : Objective-C
  • Android
  • Web
  • Flutter
  • Introduction
  • Demo app
  • Sample codes
  • Client SDKs
    • SDK downloads
    • Release notes
  • Getting started
    • Integration
    • Start a room
  • Guides
    • Customize room parameters
    • Customize the room UI
    • Listen for room callbacks
    • Screen rotation support
    • Screen sharing
    • Manage rooms with Education Cloud Service
    • Use server event callbacks
  • Server APIs
  • Error codes
  • Documentation
  • RoomKit
  • Server APIs
  • RoomKit Server APIs
  • Event callbacks
  • Server event callbacks

Server event callbacks

Last updated:2022-04-14 16:39

1 Description

When certain events occur, the RoomKit server can send out event notifications through callbacks to your app server, so that your app server can handle them accordingly.

To set up a callback, you need to provide the "callback endpoint" and "encryption parameter" for accessing your app server. If your app server returns status 200, the callback is deemed successful; otherwise, the RoomKit server retries the callback—twice by default (the first one at 1 second later and the second one 5 seconds later).

Your app server must respond to the callback within 5 seconds; otherwise, it is treated as a timeout.

For details about how to use server event callbacks, see Use server event callbacks.

2 Event definition

2.1 Room events

Event type Event description Triggerring condition
1 Room Ended
  • The session is ended by the host or administrator.
  • The room ends automatically when no one is in the room for a long time.
2 Participant Joined When a user joins the room.
3 Participant Left
  • A participant leaves the room
  • The heartbeat is deactivated because the user has been disconnected for a long time.
4 Room Started The room is started by the host.
5 Participant Removed The host or assistant removes a participant from room.
6 Room Suspended

The Roomkit backend will suspend the room if no one is online for 30 minutes.

"Suspend the room" does not mean to end the room.

7 Room Mode Changed

Change Room Mode:

  • 1: Video Mode
  • 2: Shared Mode

The following diagram shows when each of the event callbacks is triggered in a typical business process:

/Pics/RoomKit/AllPlatform/en/RoomKit_Callback_en.png

2.1.1 Room Ended

Message body of the event notification:

Parameter Type Description
event_type Int Event type.
room_id String Room ID.
timestamp Int64 Timestamp, in milliseconds.

Message example:

{
    "event_type": 1,
    "room_id": "19827033659",
    "timestamp": 1614149165898
}

2.1.2 Participant Joined

Message body of the event notification:

Parameter Type Description
event_type Int Event type.
room_id String Room ID.
timestamp Int64 Timestamp, in milliseconds.
uid Int64 User ID.
nickname String User nickname.
role Int

User role:

  • 1: Host
  • 2: Attendee

Message example:

{
    "event_type": 2,
    "nickname": "WeChat",
    "role": 2,
    "room_id": "19826903716",
    "timestamp": 1614149159658,
    "uid": 32614149156788
}

2.1.3 Participant Left

Message body of the event notification:

Parameter Type Description
event_type Int Event type.
room_id String Room ID.
timestamp Int64 Timestamp, in milliseconds.
uid Int64 User ID.
nickname String User nickname.
role Int

User role:

  • 1: Host
  • 2: Attendee

Message example:

{
    "event_type": 3,
    "nickname": "Google",
    "role": 2,
    "room_id": "19826903716",
    "timestamp": 1614149175582,
    "uid": 32614149031156
}

2.1.4 Room Started

Message body of the event notification:

Parameter Type Description
event_type Int Event type.
room_id String Room ID.
timestamp Int64 Timestamp, in milliseconds.

Message example:

{
    "event_type": 4,
    "room_id": "19827033659",
    "timestamp": 1614149165898
}

2.1.5 Participant Removed

Message body of the event notification:

Parameter Type Description
event_type Int Event type.
room_id String Room ID.
timestamp Int64 Timestamp, in milliseconds.
uid Int64 User ID.
nickname String User nickname.
role Int

User role:

  • 1: Host
  • 2: Attendee

Message example:

{
    "event_type": 5,
    "nickname": "Google",
    "role": 2,
    "room_id": "19826903716",
    "timestamp": 1614149175582,
    "uid": 32614149031156
}

2.1.6 Room Suspended

Message body of the event notification:

Parameter Type Description
event_type Int Event type.
room_id String Room ID.
timestamp Int64 Timestamp, in milliseconds.

Message example:

{
    "event_type": 6,
    "room_id": "19826903716",
    "timestamp": 1614149175582
}

2.1.7 Room Mode Changed

Message body of the event notification:

Parameter Type Description
event_type Int Event type.
room_id String Room ID.
timestamp Int64 Timestamp, in milliseconds.
room_mode Int

Changed room mode:

  • 1: Video Mode
  • 2: Shared Mode

Message example:

{
    "event_type": 7,
    "room_id": "19826903716",
    "timestamp": 1614149175582,
    "room_mode": 2
}

2.2 Whiteboard events

Event type Event description Triggerring condition
101 Whiteboard ID Changed
  • The presenter starts sharing a whiteboard.
  • The presenter starts sharing a file.
  • The presenter switches to share another whiteboard or file.
  • The presenter switches to another worksheet in the Excel file currently being shared.

2.2.1 Whiteboard ID Changed

Message body of the event notification:

Parameters Type Description
event_type Int Event type.
room_id String Room ID.
timestamp Int64 Timestamp, in milliseconds.
whiteboard_id String Whiteboard ID.

Message example:

{
     "event_type": 101,
     "room_id": "20082191900",
     "timestamp": 1617786314436,
     "whiteboard_id": "1438507235"
}
Page Directory