Basic concepts
Channel: A channel is an audio and video space (think of it as a meeting). Users in the same channel can receive each other’s real-time audio and video.Joining a channel
- Your client calls your backend’s endpoint for joining a channel
- Your backend calls
channel/grantof theserver APIto get a token and returns it to your client - Your client passes the
tokento the RTC SDK to join the channel
Opening and destroying a channel
- A channel can be opened manually (for example, when you need to set some channel properties in advance)
- If the channel is not open when the first user joins, it opens automatically
- A channel is destroyed automatically if no one joins within 2 hours after it opens, or 2 hours after the last user leaves
Channel name rules
A string of up to 64 bytes. The supported character set is:- The 26 lowercase letters a-z.
- The 26 uppercase letters A-Z.
- The 10 digits 0-9.
- ”-”, ”_”.
Conventions
- This protocol uses HTTP + JSON for transport (
application/json) - All endpoints of the protocol support
POSTonly - Strings are encoded in UTF-8
Base URL
In a standard deployment, SRTC is served at the domain root. The
/meeting/ prefix on the same domain goes to the SMeeting service,
and the two sets of endpoints are not interchangeable (see Choosing SRTC or SMeeting). For deployments on a dedicated domain, follow the access information we provide.Prerequisites
You need anapp_id and an app_key before making calls
Request headers
Signing algorithm
Step 1: Build the string to sign by joiningapp_id, nonce, timestamp, and the JSON string of the request body with &
app_key secret key.
signature
Three details that are easy to get wrong:
- The field names in the string to sign must match the request header names you actually use—if you use
app-id, writeapp-id=, notapp_id= - Sign the request body as the raw string. It must be byte-for-byte identical to what you send (including whitespace and field order); don’t serialize it again
app_keyis only used to compute the signature locally on your server. It must never appear in a request or be sent to a client
uid and sid
uidis the user ID from your own system. You assign it; the RTC side does not generate itsidis the ID of this session. The RTC side generates it when issuing the grant, and the sameuidgets a differentsideach time it joins
Callbacks
Besides the endpoints you call, the RTC side also calls back your backend when the state of a channel, user, or recording changes. See the Callback events guide.Response format
Both success and failure return HTTP 200. The business result is determined bycode.
On success, code is 0 and data contains the data
code is the error code and msg is the error description
msg above means “Invalid signature in request headers”. Check code; don’t match on the msg text. For all values, see Error codes.