Media Gateway(RTLS Ingress)
构建时从公开 REST 接口定义的 `media-gateway` 标签生成:方法、路径、参数、请求体、响应与 curl。
分组概览
本页由公开 REST 接口定义在构建时生成:标签 media-gateway,共 12 个操作(全量 189 个)。鉴权、信封与分页约定见 REST API 总览.
| 方法 | 路径 | 摘要 |
|---|---|---|
POST | /v1/projects/{appId}/rtls/ingress/online-streams/mute/{sid} | Mute or unmute one ingress stream |
PUT | /{region}/v1/projects/{appId}/rtls/ingress/appconfig | Set the global flow configuration template |
GET | /{region}/v1/projects/{appId}/rtls/ingress/online-streams | Query the online ingress streams |
GET | /{region}/v1/projects/{appId}/rtls/ingress/online-streams/{sid} | Query one ingress stream by SID |
DELETE | /{region}/v1/projects/{appId}/rtls/ingress/online-streams/{sid} | Force disconnect an ingress stream |
PUT | /{region}/v1/projects/{appId}/rtls/ingress/stream-templates/{templateId} | Create or reset a flow configuration template |
PATCH | /{region}/v1/projects/{appId}/rtls/ingress/stream-templates/{templateId} | Update a flow configuration template |
DELETE | /{region}/v1/projects/{appId}/rtls/ingress/stream-templates/{templateId} | Delete a flow configuration template |
POST | /{region}/v1/projects/{appId}/rtls/ingress/streamkeys | Create a streaming key |
GET | /{region}/v1/projects/{appId}/rtls/ingress/streamkeys/{streamkey} | Query a streaming key |
DELETE | /{region}/v1/projects/{appId}/rtls/ingress/streamkeys/{streamkey} | Delete a streaming key |
POST | /{region}/{version}/projects/{appId}/rtls/ingress/online-streams/mute/{sid} | Mute or unmute an ingress stream |
操作详情
POST /v1/projects/{appId}/rtls/ingress/online-streams/mute/{sid}
Mute or unmute one ingress stream
Same handler as the regional spellings (registerAliases in routes/rtmp-gateway.ts): settings are applied to the live session and the response is the Agora-style { status: 'success' } acknowledgement.
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
appId | path | 是 | string | pattern ^[a-f0-9]{32}$ |
sid | path | 是 | string | 长度 0..128 |
响应
| 状态码 | 说明 / schema |
|---|---|
200 | the mute command was executed — object{ status } |
调用示例
curl -s -X POST "$NIMEET_API_BASE/v1/projects/appId/rtls/ingress/online-streams/mute/$SID" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"PUT /{region}/v1/projects/{appId}/rtls/ingress/appconfig
Set the global flow configuration template
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
region | path | 是 | enum(cn | ap | na | eu) | |
appId | path | 是 | string | pattern ^[a-f0-9]{32}$ |
请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
settings | object{ defaultStreamTemplate } | 是 |
{
"settings": {
"defaultStreamTemplate": "string"
}
}响应
| 状态码 | 说明 / schema |
|---|---|
200 | the global template was set — object{ status } |
400 | Invalid parameter — Error |
401 | Missing/invalid credentials — Error |
403 | Banned or service not enabled — Error |
404 | Resource not found — Error |
415 | Content-Type must be application/json — Error |
429 | Quota exceeded — Error |
调用示例
curl -s -X PUT "$NIMEET_API_BASE/cn-shanghai/v1/projects/appId/rtls/ingress/appconfig" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC" \
-H "Content-Type: application/json" \
-d '{"settings":{"defaultStreamTemplate":"string"}}'GET /{region}/v1/projects/{appId}/rtls/ingress/online-streams
Query the online ingress streams
Lists the sessions that are currently pushing. A session exists exactly while the publisher bound to a live stream key is inside the channel.
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
region | path | 是 | enum(cn | ap | na | eu) | |
appId | path | 是 | string | pattern ^[a-f0-9]{32}$ |
channel | query | string |
响应
| 状态码 | 说明 / schema |
|---|---|
200 | online streams — object{ status, data } |
400 | Invalid parameter — Error |
401 | Missing/invalid credentials — Error |
403 | Banned or service not enabled — Error |
404 | Resource not found — Error |
415 | Content-Type must be application/json — Error |
429 | Quota exceeded — Error |
调用示例
curl -s -X GET "$NIMEET_API_BASE/cn-shanghai/v1/projects/appId/rtls/ingress/online-streams?channel=value" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"GET /{region}/v1/projects/{appId}/rtls/ingress/online-streams/{sid}
Query one ingress stream by SID
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
region | path | 是 | enum(cn | ap | na | eu) | |
appId | path | 是 | string | pattern ^[a-f0-9]{32}$ |
sid | path | 是 | string | 长度 0..128 |
响应
| 状态码 | 说明 / schema |
|---|---|
200 | the session — object{ status, data } |
400 | Invalid parameter — Error |
401 | Missing/invalid credentials — Error |
403 | Banned or service not enabled — Error |
404 | Resource not found — Error |
415 | Content-Type must be application/json — Error |
429 | Quota exceeded — Error |
调用示例
curl -s -X GET "$NIMEET_API_BASE/cn-shanghai/v1/projects/appId/rtls/ingress/online-streams/$SID" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"DELETE /{region}/v1/projects/{appId}/rtls/ingress/online-streams/{sid}
Force disconnect an ingress stream
Kicks the publisher out of the channel through the media plane. Delete the streaming key first, otherwise the publisher reconnects with a new SID.
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
region | path | 是 | enum(cn | ap | na | eu) | |
appId | path | 是 | string | pattern ^[a-f0-9]{32}$ |
sid | path | 是 | string | 长度 0..128 |
响应
| 状态码 | 说明 / schema |
|---|---|
200 | the disconnection command was executed — object{ status } |
400 | Invalid parameter — Error |
401 | Missing/invalid credentials — Error |
403 | Banned or service not enabled — Error |
404 | Resource not found — Error |
415 | Content-Type must be application/json — Error |
429 | Quota exceeded — Error |
调用示例
curl -s -X DELETE "$NIMEET_API_BASE/cn-shanghai/v1/projects/appId/rtls/ingress/online-streams/$SID" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"PUT /{region}/v1/projects/{appId}/rtls/ingress/stream-templates/{templateId}
Create or reset a flow configuration template
Up to ten templates can exist under one app id. Reusing a template id resets it with the incoming settings.
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
region | path | 是 | enum(cn | ap | na | eu) | |
appId | path | 是 | string | pattern ^[a-f0-9]{32}$ |
templateId | path | 是 | string | pattern ^[A-Za-z0-9]{1,12}$ |
请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
settings | object{ transcoding, jitterBuffer } | 是 |
{
"settings": {
"transcoding": {},
"jitterBuffer": {}
}
}响应
| 状态码 | 说明 / schema |
|---|---|
200 | the template was stored — object{ status } |
400 | Invalid parameter — Error |
401 | Missing/invalid credentials — Error |
403 | Banned or service not enabled — Error |
404 | Resource not found — Error |
415 | Content-Type must be application/json — Error |
429 | Quota exceeded — Error |
调用示例
curl -s -X PUT "$NIMEET_API_BASE/cn-shanghai/v1/projects/appId/rtls/ingress/stream-templates/templateId" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC" \
-H "Content-Type: application/json" \
-d '{"settings":{"transcoding":{},"jitterBuffer":{}}}'PATCH /{region}/v1/projects/{appId}/rtls/ingress/stream-templates/{templateId}
Update a flow configuration template
transcoding.video, transcoding.audio and jitterBuffer are independent: only the parts present in the body are replaced.
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
region | path | 是 | enum(cn | ap | na | eu) | |
appId | path | 是 | string | pattern ^[a-f0-9]{32}$ |
templateId | path | 是 | string | pattern ^[A-Za-z0-9]{1,12}$ |
请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
settings | object{ transcoding, jitterBuffer } | 是 |
{
"settings": {
"transcoding": {},
"jitterBuffer": {}
}
}响应
| 状态码 | 说明 / schema |
|---|---|
200 | the template was updated — object{ status } |
400 | Invalid parameter — Error |
401 | Missing/invalid credentials — Error |
403 | Banned or service not enabled — Error |
404 | Resource not found — Error |
415 | Content-Type must be application/json — Error |
429 | Quota exceeded — Error |
调用示例
curl -s -X PATCH "$NIMEET_API_BASE/cn-shanghai/v1/projects/appId/rtls/ingress/stream-templates/templateId" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC" \
-H "Content-Type: application/json" \
-d '{"settings":{"transcoding":{},"jitterBuffer":{}}}'DELETE /{region}/v1/projects/{appId}/rtls/ingress/stream-templates/{templateId}
Delete a flow configuration template
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
region | path | 是 | enum(cn | ap | na | eu) | |
appId | path | 是 | string | pattern ^[a-f0-9]{32}$ |
templateId | path | 是 | string | pattern ^[A-Za-z0-9]{1,12}$ |
响应
| 状态码 | 说明 / schema |
|---|---|
200 | the template was deleted — object{ status } |
400 | Invalid parameter — Error |
401 | Missing/invalid credentials — Error |
403 | Banned or service not enabled — Error |
404 | Resource not found — Error |
415 | Content-Type must be application/json — Error |
429 | Quota exceeded — Error |
调用示例
curl -s -X DELETE "$NIMEET_API_BASE/cn-shanghai/v1/projects/appId/rtls/ingress/stream-templates/templateId" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"POST /{region}/v1/projects/{appId}/rtls/ingress/streamkeys
Create a streaming key
Authorises one (channel, uid) pair to push into the gateway, optionally bound to a flow configuration template and an expiry.
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
region | path | 是 | enum(cn | ap | na | eu) | |
appId | path | 是 | string | pattern ^[a-f0-9]{32}$ |
请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
settings | object{ channel, uid, expiresAfter, templateId } | 是 |
{
"settings": {
"expiresAfter": 1,
"channel": "string",
"uid": "10001"
}
}响应
| 状态码 | 说明 / schema |
|---|---|
200 | the created streaming key — object{ status, data } |
400 | Invalid parameter — Error |
401 | Missing/invalid credentials — Error |
403 | Banned or service not enabled — Error |
404 | Resource not found — Error |
415 | Content-Type must be application/json — Error |
429 | Quota exceeded — Error |
调用示例
curl -s -X POST "$NIMEET_API_BASE/cn-shanghai/v1/projects/appId/rtls/ingress/streamkeys" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC" \
-H "Content-Type: application/json" \
-d '{"settings":{"expiresAfter":1,"channel":"string","uid":"10001"}}'GET /{region}/v1/projects/{appId}/rtls/ingress/streamkeys/{streamkey}
Query a streaming key
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
region | path | 是 | enum(cn | ap | na | eu) | |
appId | path | 是 | string | pattern ^[a-f0-9]{32}$ |
streamkey | path | 是 | string | 长度 0..255 |
响应
| 状态码 | 说明 / schema |
|---|---|
200 | the streaming key — object{ status, data } |
400 | Invalid parameter — Error |
401 | Missing/invalid credentials — Error |
403 | Banned or service not enabled — Error |
404 | Resource not found — Error |
415 | Content-Type must be application/json — Error |
429 | Quota exceeded — Error |
调用示例
curl -s -X GET "$NIMEET_API_BASE/cn-shanghai/v1/projects/appId/rtls/ingress/streamkeys/streamkey" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"DELETE /{region}/v1/projects/{appId}/rtls/ingress/streamkeys/{streamkey}
Delete a streaming key
Revokes the key. An ongoing push is not interrupted; use force disconnect with its SID for that.
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
region | path | 是 | enum(cn | ap | na | eu) | |
appId | path | 是 | string | pattern ^[a-f0-9]{32}$ |
streamkey | path | 是 | string | 长度 0..255 |
响应
| 状态码 | 说明 / schema |
|---|---|
200 | the key was revoked — object{ status } |
400 | Invalid parameter — Error |
401 | Missing/invalid credentials — Error |
403 | Banned or service not enabled — Error |
404 | Resource not found — Error |
415 | Content-Type must be application/json — Error |
429 | Quota exceeded — Error |
调用示例
curl -s -X DELETE "$NIMEET_API_BASE/cn-shanghai/v1/projects/appId/rtls/ingress/streamkeys/streamkey" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"POST /{region}/{version}/projects/{appId}/rtls/ingress/online-streams/mute/{sid}
Mute or unmute an ingress stream
Applies to the current session only: the mute state resets when the publisher reconnects.
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
region | path | 是 | enum(cn | ap | na | eu) | |
version | path | 是 | enum(v1) | |
appId | path | 是 | string | pattern ^[a-f0-9]{32}$ |
sid | path | 是 | string | 长度 0..128 |
请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
settings | object{ videoMuted, audioMuted } | 是 |
{
"settings": {
"videoMuted": true,
"audioMuted": true
}
}响应
| 状态码 | 说明 / schema |
|---|---|
200 | the mute command was executed — object{ status } |
400 | Invalid parameter — Error |
401 | Missing/invalid credentials — Error |
403 | Banned or service not enabled — Error |
404 | Resource not found — Error |
415 | Content-Type must be application/json — Error |
429 | Quota exceeded — Error |
调用示例
curl -s -X POST "$NIMEET_API_BASE/cn-shanghai/v1/projects/appId/rtls/ingress/online-streams/mute/$SID" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC" \
-H "Content-Type: application/json" \
-d '{"settings":{"videoMuted":true,"audioMuted":true}}'本分组用到的 Schema
Error — object{ code, message, reason, sdkCode, details }
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
code | string | 是 | stable machine code, see errors.json |
message | string | 是 | |
reason | string | ||
sdkCode | integer | Agora-aligned client error number | |
details | object |