声网兼容频道查询
构建时从公开 REST 接口定义的 `agora-channel` 标签生成:方法、路径、参数、请求体、响应与 curl。
分组概览
本页由公开 REST 接口定义在构建时生成:标签 agora-channel,共 8 个操作(全量 189 个)。鉴权、信封与分页约定见 REST API 总览.
| 方法 | 路径 | 摘要 |
|---|---|---|
GET | /dev/v1/channel/user/property/{appid}/{uid}/{channelName} | Agora: user status in a channel |
GET | /dev/v1/channel/user/{appid}/{channelName} | Agora: list users in a channel |
GET | /dev/v1/channel/user/{appid}/{channelName}/hosts_only | Query the host list of a live channel |
GET | /dev/v1/channel/{appid} | Agora: list channels |
GET | /dev/v1/kicking-rule | Agora: list kicking rules |
POST | /dev/v1/kicking-rule | Agora: create kicking rule |
PUT | /dev/v1/kicking-rule | Agora: update kicking rule |
DELETE | /dev/v1/kicking-rule | Agora: delete kicking rule |
操作详情
GET /dev/v1/channel/user/property/{appid}/{uid}/{channelName}
Agora: user status in a channel
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
appid | path | 是 | string | pattern ^[a-f0-9]{32}$ |
uid | path | 是 | integer | 1..2147483647 |
channelName | path | 是 | string | 长度 0..128 |
响应
| 状态码 | 说明 / schema |
|---|---|
200 | Agora: user property in a channel — object{ success, data } |
401 | Missing/invalid credentials — Error |
调用示例
curl -s -X GET "$NIMEET_API_BASE/dev/v1/channel/user/property/$APP_ID/10001/weekly-sync" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"GET /dev/v1/channel/user/{appid}/{channelName}
Agora: list users in a channel
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
appid | path | 是 | string | pattern ^[a-f0-9]{32}$ |
channelName | path | 是 | string | 长度 0..128 |
hosts_only | query | boolean |
响应
| 状态码 | 说明 / schema |
|---|---|
200 | Agora: channel user list — object{ success, data } |
401 | Missing/invalid credentials — Error |
调用示例
curl -s -X GET "$NIMEET_API_BASE/dev/v1/channel/user/$APP_ID/weekly-sync?hosts_only=true" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"GET /dev/v1/channel/user/{appid}/{channelName}/hosts_only
Query the host list of a live channel
Returns the broadcasters of a live channel only; the dedicated path is equivalent to ?hosts_only=.
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
appid | path | 是 | string | pattern ^[a-f0-9]{32}$ |
channelName | path | 是 | string | 长度 0..128 |
响应
| 状态码 | 说明 / schema |
|---|---|
200 | hosts of the channel — object{ success, 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/dev/v1/channel/user/$APP_ID/weekly-sync/hosts_only" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"GET /dev/v1/channel/{appid}
Agora: list channels
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
appid | path | 是 | string | pattern ^[a-f0-9]{32}$ |
page_no | query | integer | >= 0,默认 0 | |
page_size | query | integer | 1..500,默认 100 |
响应
| 状态码 | 说明 / schema |
|---|---|
200 | Agora: { success, data: { channels, total_size } } — object{ success, data } |
401 | Missing/invalid credentials — Error |
调用示例
curl -s -X GET "$NIMEET_API_BASE/dev/v1/channel/$APP_ID?page_no=0&page_size=100" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"GET /dev/v1/kicking-rule
Agora: list kicking rules
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
appid | query | 是 | string |
响应
| 状态码 | 说明 / schema |
|---|---|
200 | Agora: { status, rules } — object{ status, rules } |
400 | Invalid parameter — Error |
401 | Missing/invalid credentials — Error |
调用示例
curl -s -X GET "$NIMEET_API_BASE/dev/v1/kicking-rule?appid=%24APP_ID" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"POST /dev/v1/kicking-rule
Agora: create kicking rule
鉴权:项目凭证(customerId:customerSecret 的 Base64)
请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
appid | string | 是 | |
cname | string | ||
uid | integer | ||
ip | string | ||
time | integer | ban minutes;0..1440 | |
time_in_seconds | integer | 0..86430 | |
privileges | array<enum(join_channel | publish_audio | publish_video)> | 是 |
{
"appid": "$APP_ID",
"cname": "weekly-sync",
"uid": 10001,
"time": 10,
"privileges": [
"join_channel"
]
}响应
| 状态码 | 说明 / schema |
|---|---|
200 | Agora: { status: "success", id } — object{ status, id } |
400 | Invalid parameter — Error |
401 | Missing/invalid credentials — Error |
调用示例
curl -s -X POST "$NIMEET_API_BASE/dev/v1/kicking-rule" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC" \
-H "Content-Type: application/json" \
-d '{"appid":"$APP_ID","cname":"weekly-sync","uid":10001,"time":10,"privileges":["join_channel"]}'PUT /dev/v1/kicking-rule
Agora: update kicking rule
鉴权:项目凭证(customerId:customerSecret 的 Base64)
请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
appid | string | 是 | |
id | integer | 是 | |
time | integer | ||
time_in_seconds | integer | ||
privileges | array<string> |
{
"appid": "$APP_ID",
"cname": "weekly-sync",
"uid": 10001,
"time": 10,
"privileges": [
"join_channel"
]
}响应
| 状态码 | 说明 / schema |
|---|---|
200 | Agora: { status: "success", id } — object{ status, id } |
400 | Invalid parameter — Error |
401 | Missing/invalid credentials — Error |
调用示例
curl -s -X PUT "$NIMEET_API_BASE/dev/v1/kicking-rule" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC" \
-H "Content-Type: application/json" \
-d '{"appid":"$APP_ID","cname":"weekly-sync","uid":10001,"time":10,"privileges":["join_channel"]}'DELETE /dev/v1/kicking-rule
Agora: delete kicking rule
鉴权:项目凭证(customerId:customerSecret 的 Base64)
请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
appid | string | 是 | |
id | integer | 是 |
{
"appid": "$APP_ID",
"cname": "weekly-sync",
"uid": 10001,
"time": 10,
"privileges": [
"join_channel"
]
}响应
| 状态码 | 说明 / schema |
|---|---|
200 | Agora: { status: "success", id } — object{ status, id } |
400 | Invalid parameter — Error |
401 | Missing/invalid credentials — Error |
调用示例
curl -s -X DELETE "$NIMEET_API_BASE/dev/v1/kicking-rule" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC" \
-H "Content-Type: application/json" \
-d '{"appid":"$APP_ID","cname":"weekly-sync","uid":10001,"time":10,"privileges":["join_channel"]}'本分组用到的 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 |