Skip to content

Server API

This page describes Room server-side public APIs. Your application server uses the Token API to request short-lived room credentials, then securely delivers the returned peer_id and token to the device. For device-side connection, see Device Integration.

Authentication (TGV1-HMAC-SHA256)

The signing method is the same as Tange Cloud OpenAPI server-side signing. See Server API Signature Algorithm Demo.

Issue Room Token

POST /v1/token/room

Headers

HeaderRequiredDescription
Content-TypeYesFixed to application/json.
X-Tg-App-IdYesApplication ID.
AuthorizationYesTGV1 server-side signature in the format TGV1-HMAC-SHA256 Credential=..., SignedHeaders=..., Signature=....

Request Body

json
{
  "room_id": "order-20260611-001",
  "device_id": "device-001"
}
FieldTypeRequiredDescription
room_idstringYesBusiness logical room ID.
device_idstringYesDevice ID. The default participant can map to device_{device_id}.

Example Response

json
{
  "peer_id": "room_peer_order_20260611_001_device_001",
  "token": "v1.{claimB64}.{sig}"
}

peer_id is the device connection target identifier. The application server should not parse or rewrite it. When the device calls TiRTC TiRtcWhipConnect, it should pass this peer_id and token together.

Common Errors

HTTP statusDescription
400Invalid request parameters, such as empty room_id or device_id.
401App authentication failed. Check the application ID, TGV1 signature time, signed headers, and Body SHA-256.
403The application or device does not have permission to join the room.
429Room participant limit exceeded.
503The service is temporarily unavailable. Retry later or contact technical support.

Room