ZEGO Live
  • iOS
  • Android : Java
  • Introduction
  • Sample app
  • Getting started
  • Guides
    • Room
    • Co-host
    • Face beautify
    • Sound effects
    • Room related Server APIs
  • Error codes
  • Documentation
  • ZEGO Live
  • Guides
  • Room related Server APIs

Room related Server APIs

Last updated:2022-05-26 10:02

The Server APIs that we used to implement live room related business logic in the ZEGO Live sample app are only for experience and debugging purposes.

To build your own live streaming app, you can refer to ours and design your own business server APIs and replace them in our sample code.




Overview

The ZEGOLive SDK uses the business Server APIs listed in this document when implementing room related logic (create/join/leave a live room) for generating a live room list. And the client that has integrated the ZEGOLive SDK can use the live room list for display.

You can find the definition and the way to call these business Server APIs in the class RoomListService in the ZEGOLive SDK, and modify and re-design to your own business Server APIs.

For any questions when defining your own business Server APIs, you can feel free to contact us for technical support.

Business Server APIs

Get a room list

  • uri: /v1/room/get_room_list
  • Feature description: This feature can be implemented to get a live room list, including the room ID, room name, host ID, time created, and the number of in-room participants, and more.
  • Call this at: When you want to display the live room list.

Create a live room

  • uri: /v1/room/create_room
  • Feature description: This can be used to inform the server that a live room is created. The ongoing live room will show in the room list.
  • Call this at: When creating a live room.

Join a live room

  • uri: /v1/room/join_room
  • Feature description: This can be used to inform the server side that a new participant joins the live room, and the server calculates the number of participants in the room based on this.
  • Call this at: When a user wants to join a live room to be a participant.

In-room heartbeat

  • uri: /v1/room/heartbeat
  • Feature descrition: Participants in the room need to call this periodically. If the server does not receive the heartbeat within a certain period, it determines that the participant is offline. If the host gets offline, the live room ended automatically. If a participant gets offline, the server updates the number of in-room participants.
  • Call this at: After creating, joining a live room, and also before you leave a live room.

Leave a live room

  • uri: /v1/room/leave_room
  • Feature description: This can be used to inform the server that an existing participant left the live room, and the server calculates the number of participants in the room based on this.
  • Call this at: When a participant wants to leave a live room. For a host to leave a live room, use the API shown below.

End a live room

  • uri: /v1/room/end_room
  • Feature description: This can be used to inform the server that a live room has ended, and the ended room will be removed from the room list.
  • Call this at: When a host wants to end a live room.
Page Directory