WebRTC 客户端管理 API¶
获取客户端列表¶
-
POST
/v0.1/sapi/webrtcclient/list
¶ 获取
sapi.WebRtcClient
实例列表Request JSON Object: - page (int) – 要返回的页码。如果不指定,默认为1(从1开始)。
- perPage (int) – 每页长度。如果不指定,服务器采用其默认设置。
Response JSON Object: - currentPage (int) – 当前返回结果的页码(从1开始)。
- perPage (int) – 每页长度。
- totalPages (int) – 总页数。
- totalEntries (int) – 总条目数。
- entries (list) –
sapi.WebRtcClient
对象列表。
举例
客户端调用:
POST /v0.1/sapi/webrtcclient/list HTTP/1.1
Host: api.linkrtc.com
Content-Type: application/json; charset=utf-8
Content-Length: xxx
{
"page": 1,
"perPage": 20
}
服务器回复:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: xxx
{
"currentPage": 1,
"perPage": 20,
"totalPages": 3,
"totalEntries": 57,
"entries": [
{"..": "...", "..": "...", "..": "..."},
{"..": "...", "..": "...", "..": "..."}
]
}
获取客户端详情¶
-
GET
/v0.1/sapi/webrtcclient/
(str: webrtcclient_id)/detail
¶ 获取指定 id (webrtcclient_id) 的
sapi.WebRtcClient
实例的详情Response JSON Object: - data (object) –
sapi.WebRtcClient
对象
举例
客户端调用:
GET /v0.1/sapi/webrtcclient/1001/detail HTTP/1.1 Host: api.linkrtc.com
服务器回复:
HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 Content-Length: xxx { "data": { "id": "xxxxx", "from": "xxxxx", "to": "xxxxx", "...": "..." } }
- data (object) –
新建客户端¶
-
POST
/v0.1/sapi/webrtcclient/create
¶ 新建一个
sapi.WebRtcClient
对象Request JSON Object: - id (str) – 要新建的
sapi.WebRtcClient
对象的 id
Response JSON Object: - data (object) – 新建的
sapi.WebRtcClient
对象
- id (str) – 要新建的
删除客户端¶
-
POST
/v0.1/sapi/webrtcclient/
(str: webrtcclient_id)/remove
¶ 删除指定 id (webrtcclient_id) 的
sapi.WebRtcClient
实例