Hoang Minh
Hoang Minh

Reputation: 1230

Is there a REST api to create a channel in Agora Web sdk?

I'm trying to integrate our web app with voice/video call feature by using Agora. I have read the documentation on their side, but I have not found any rest api for web sdk to create channel. Basically, when a user joins a channel, we have to pass in the app id, token, and channel name. I know that we can create channel in agora dashboard, but I'm looking for a dynamic way, where we can trigger a REST api to do it. Any help would be greatly appreciated. Thank you.

Upvotes: 0

Views: 1253

Answers (2)

Hoang Minh
Hoang Minh

Reputation: 1230

I have been able to build a node js to generate agora io token. It is hosted in heroku. The source code can be found here: https://github.com/Hoang-Minh/partie-agora-token-generator

Here are the endpoint that you can call to generate a token:

api/agora/rtcToken/:tokenType where

  • tokenType can be either uid or account, depends on what you need.
  • The default expiration time that I have is 24 hours.

Upvotes: 0

Ekaansh Arora
Ekaansh Arora

Reputation: 1314

You can deploy your own token server, that will give you the token based on a channel name and uid.

Here's a pre-built server that you can deploy to Heroku in 2 clicks.

Upvotes: 1

Related Questions