Giter Club home page Giter Club logo

zegocloud-demo's Introduction

NodeJS Server Example - ZEGOCLOUD Room List

Deploy

This is an example of a server program for "querying the room list under your appid"

Notice

  1. This function needs to contact us to activate it to use
  2. Since this function has a QPS limit of 20/s, we have made a simple 500ms cache logic in the example

Getting started

Create ZEGOCLOUD project

Create project on ZEGOCLOUD Console, then get the required info as shown below:

Deploy service

  1. Click this deploy button at the top of this page to start deploy your service.

1654767167240.png

  1. Pick your Heroku app-name and fill in the input box.
  2. Fill in the appid and serverSecret of your zegocloud projectPress Deploy App button, wait for the depoly process completed
  3. Once done you will get an url for your instance, try accessing https://<heroku url>/describe_room_list to check if it works.

After deplopyed successfully, you can get your server url by click this view button

1654773020234.png

After clicking, you will be redirected to your-app-name.herokuapp.com, you can test your api by appending /describe_room_list to that url.

you will get a json response

1654773265675.png

ZEGOCLOUD room list protocol description

The following is the description of the zegocloud server interface, which is thid demo used

Interface prototype

  • Interface name: get room list
  • Request method: GET
  • Request path: /?Action=DescribeRoomList

Query parameters

Parameter name Required Description
AppId Required
Signature Required
SignatureNonce Required
SignatureVersion Required
Timestamp Required
PageIndex Not required The page number of the query, default value: 1. The page number should not be greater than [Total/PageSize], otherwise it will not contain any room data.
PageSize Optional Number of rooms per page, default: 100. Value range [1,200].

Response

Parameter name Type Required Remarks
Code number Required
Message string Required
RequestId string Required
Data object Not required
..└ TotalCount integer optional total number of rooms
..└ RoomList array Not required Room list, sorted as: number of people from most to least
....└ RoomId string Optional RoomId
....└ UserCount integer optional number of users

Example

request

curl --location --request GET 'https://rtc-api.zego.im/?Action=DescribeRoomList&AppId=1111111111&Timestamp=1654767863&Signature=ttttttttttt&SignatureVersion=2.0&SignatureNonce=bbe594dbabdd3502&PageIndex=1&PageSize=200'

response

{
     "Code": 0,
     "Data": {
         "TotalCount": 3,
         "RoomList": [
             {
                 "RoomId": "room2",
                 "UserCount": 3
             },
             {
                 "RoomId": "room1",
                 "UserCount": 2
             },
             {
                 "RoomId": "room3",
                 "UserCount": 1
             }
         ]
     },
     "Message": "success",
     "RequestId": "TestRequestId1653535713776559000"
}

About us

https://www.zegocloud.com/

License

The MIT License (MIT).

zegocloud-demo's People

Contributors

yogender-kulshrestha avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.