Web 服务器 API
Web 服务器 REST API,用于会议管理、URL 入会、直播与录制等。
预约会议
请求 URL: https://xx.com/WebAPI/meetingcreate
请求方式: POST(Content-Type: multipart/form-data)
参数:
| 参数名 | 必选 | 类型 | 说明 |
|---|---|---|---|
| key | 是 | string | 企业 ID |
| meetingname | 是 | string | 会议名称 |
| starttime | 是 | string | 会议开始时间(时间戳,精确到秒),例:1429242959 |
| endtime | 否 | string | 会议结束时间(不填为永久),例:1429242959 |
| chairmanpwd | 是 | string | 主席密码,4 ≤ 长度 ≤ 20 |
| islive | 否 | string | 1 为直播,0 为不直播 |
返回示例:
{
"version": 1173,
"serial": 754884357,
"roomid": "5ff66be5bfc2421a04767eb7",
"sig": "203usx24yeijd3zjfbpTqWGskyA2Hw7z9ngrZDQFV8=",
"pushurl": "域名/app/754884357?auth_key=1801234303-0-0-ca771167c25b04bea29b8f8afb3cb84d",
"pullurl": "域名/live/754884357.m3u8?auth_key=1801234303-0-0-a636d01ebded4dd94c5276da00c7530d",
"pullurl2": "域名/hls/754884357.m3u8",
"recordpath": "域名/upload/754884357.mp4",
"result": 0
}返回参数:
| 参数名 | 类型 | 说明 |
|---|---|---|
| serial | int | 会议号 |
| roomid | string | 连接媒服的 roomid |
| sig | string | 分享会议时使用 |
| pushurl | string | 推流地址 |
| pullurl | string | 拉流地址 |
| recordpath | string | 录制文件地址 |
| result | string | 0 表示成功,其它为错误 |
修改会议
请求 URL: https://xx.com/WebAPI/meetingmodify
请求方式: POST(Content-Type: multipart/form-data)
参数:
| 参数名 | 必选 | 类型 | 说明 |
|---|---|---|---|
| key | 是 | string | 企业 ID |
| serial | 是 | string | 会议号 |
| meetingname | 否 | string | 会议名称 |
| chairmanpwd | 否 | string | 主席密码,4 ≤ 长度 ≤ 20 |
| starttime | 是 | string | 会议开始时间(时间戳,精确到秒) |
| endtime | 否 | string | 会议结束时间(不填为永久) |
返回示例:
{
"result": 0,
"serial": 431383322
}删除会议
请求 URL: https://xx.com/WebAPI/meetingdelete
请求方式: POST(Content-Type: multipart/form-data)
参数:
| 参数名 | 必选 | 类型 | 说明 |
|---|---|---|---|
| key | 是 | string | 企业 ID |
| serial | 是 | string | 会议号 |
返回示例:
{
"version": 1174,
"serial": "662498204",
"result": 0
}获取上课时长
请求 URL: https://xx.com/WebAPI/getClassBeginTime
请求方式: GET
参数:
| 参数名 | 必选 | 类型 | 说明 |
|---|---|---|---|
| key | 是 | string | 企业 ID |
| serial | 是 | string | 会议号 |
返回示例:
{
"result": 0,
"serial": 431383322,
"duration": 3600
}会议关联文档
请求 URL: https://xx.com/WebAPI/meetingbindfile
请求方式: POST(Content-Type: multipart/form-data)
参数:
| 参数名 | 必选 | 类型 | 说明 |
|---|---|---|---|
| key | 是 | string | 企业 ID |
| serial | 是 | string | 会议号 |
| fileidarr[] | 是 | array | 文件 id |
返回示例:
{
"result": 0
}修改会议背景
请求 URL: https://xx.com/WebAPI/uploadRoomPic
请求方式: POST(Content-Type: multipart/form-data)
参数:
| 参数名 | 必选 | 类型 | 说明 |
|---|---|---|---|
| key | 是 | string | 企业 ID |
| filedata | 是 | file | 文件 |
| serial | 是 | string | 会议号 |
返回示例:
{
"result": 0,
"picPath": "/uploads/20210107_104711_ltqpupbr.png"
}获取会议的文档列表
请求 URL: https://xx.com/WebAPI/getmeetingfile
请求方式: GET
参数:
| 参数名 | 必选 | 类型 | 说明 |
|---|---|---|---|
| key | 是 | string | 企业 ID |
| serial | 是 | string | 会议号 |
返回示例:
{
"result": 0,
"meetingfile": [
{
"fileid": "494",
"filename": "1.png",
"downloadpath": "/upload/20210107_104054_ratndkwo.png",
"filetype": "png"
}
]
}获取直播
请求 URL: https://xx.com/WebAPI/getLiveStream
请求方式: GET
参数:
| 参数名 | 必选 | 类型 | 说明 |
|---|---|---|---|
| key | 是 | string | 企业 ID |
| serial | 否 | string | 会议号 |
返回示例:
{
"result": 0,
"cdnStreams": [{
"serial": "",
"pullUrl": ""
}],
"serverStreams": [{
"serial": "",
"pullUrl": ""
}]
}会议成员进出记录
请求 URL: https://xx.com/WebAPI/getlogininfo
请求方式: POST(Content-Type: multipart/form-data)
参数:
| 参数名 | 必选 | 类型 | 说明 |
|---|---|---|---|
| key | 是 | string | 企业 ID |
| serial | 是 | string | 会议号 |
返回示例:
{
"result": 0,
"logininfo": [
{
"userid": "D171LM9P",
"entertime": "2020-12-30 09:56:50",
"serial": "111111",
"leavetime": "2020-12-30 09:58:20"
}
]
}URL 加入会议(多参数)
请求 URL:
https://xx.com/h5/#/login?serial=123456789&userid=1234&username=name&invisible=1&joinRole=presenter请求方式: GET
参数:
| 参数名 | 必选 | 类型 | 说明 |
|---|---|---|---|
| serial | 是 | string | 会议号 |
| userid | 是 | string | 用户 id,保持唯一 |
| username | 是 | string | 昵称 |
| invisible | 是 | string | 0 或 1,1 为隐身 |
| joinRole | 是 | string | presenter 普通用户,speaker 主讲,chairman 主席 |
URL 加入会议(单参数)
请求 URL:
https://xx.com/h5/index.html?token=1zxcasd23123123124.....请求方式: GET
Token 创建方式:
Java 版本:
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.util.*;
/**
* AES-256 加密方式,需要 jdk1.8_161 以上版本
*/
public class Token {
public static void main(String[] args) throws Exception {
String param = "{\"serial\":\"111111\",\"userid\":\"123456\",\"username\":\"weiyi我\",\"joinRole\":\"presenter\"}";
System.out.println(getToken(param));;
}
public static String getToken(String value) throws Exception {
byte[] key = longHex2Bin("34b7ee4783925cfc4b5c75116f6f9de52181a450f0ad499fcc9b84e6e55fec33"); // key 值会提供
byte[] iv = longHex2Bin("e116172f58fe068ba347992514110c83");// 值会提供
String encrypted_data = java_openssl_encrypt(jsonEncode(value), key, iv);
System.out.println(encrypted_data);
return encrypted_data;
}
public static String java_openssl_encrypt(String data,byte[] Key, byte[] iv) throws Exception {
try {
Cipher cipher = createCipher(Key, iv, Cipher.ENCRYPT_MODE);
return URLEncoder.encode(Base64.getEncoder().encodeToString(cipher.doFinal(data.getBytes())), "UTF-8");
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
} catch (NoSuchPaddingException e) {
e.printStackTrace();
} catch (InvalidKeyException e) {
e.printStackTrace();
} catch (InvalidAlgorithmParameterException e) {
e.printStackTrace();
} catch (IllegalBlockSizeException e) {
e.printStackTrace();
} catch (BadPaddingException e) {
e.printStackTrace();
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return null;
}
private static Cipher createCipher(byte[] KEY, byte[] iv, int mode) throws NoSuchAlgorithmException, NoSuchPaddingException,
InvalidKeyException, InvalidAlgorithmParameterException {
byte[] key =KEY;
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
IvParameterSpec ivParameterSpec = new IvParameterSpec(iv);
cipher.init(mode, new SecretKeySpec(key, "AES"), ivParameterSpec);
return cipher;
}
public static byte[] longHex2Bin(String s) {
byte[] baKeyword = new byte[s.length() / 2];
for (int i = 0; i < baKeyword.length; i++) {
try {
baKeyword[i] = (byte) (0xff & Integer.parseInt(s.substring(
i * 2, i * 2 + 2), 16));
} catch (Exception e) {
e.printStackTrace();
}
}
return baKeyword;
}
private static String jsonEncode(Object map) throws JsonProcessingException {
String s = new ObjectMapper().writeValueAsString(map);
s = s.replace("/", "\\/");
s = chineseCharacterToUnicode(s);
return s;
}
private static String chineseCharacterToUnicode(String str) {
String result = "";
for (int i = 0; i < str.length(); i++) {
int chr1 = (char) str.charAt(i);
if (chr1 >= 19968 && chr1 <= 171941) {
result += "\\\\u" + Integer.toHexString(chr1);
} else {
result += str.charAt(i);
}
}
return result;
}
}PHP 方式:
function token() {
$passkey = 'SYXCXASD'; // 提供
$passphrase = "AYQTYCAXAX"; // 提供
$arr = array('serial' => '111111', 'userid' => '123456', 'username' => 'weiyi我', "joinRole"=>"presenter");
$encrypt_data = json_encode($arr);
$encrypted = getToken($encrypt_data, $passkey, $passphrase);
echo $encrypted;
}
function getToken($value, $passkey, $passphrase) {
$salted = '';
$dx = '';
while (strlen($salted) < 48) {
$dx = md5($dx . $passphrase . $passkey, true);
$salted .= $dx;
}
$key = substr($salted, 0, 32);
$iv = substr($salted, 32, 16);
$encrypted_data = openssl_encrypt(json_encode($value), 'aes-256-cbc', $key, 1, $iv);
$token = urlencode(base64_encode($encrypted_data));
return $token;
}获取录制文件
请求 URL: https://xx.com/WebAPI/getRoomRecord
请求方式: POST(Content-Type: multipart/form-data)
参数:
| 参数名 | 必选 | 类型 | 说明 |
|---|---|---|---|
| key | 是 | string | 企业 ID |
| serial | 否 | string | 会议号 |
| userid | 否 | string | 关联的用户 |
返回示例:
{
"code": 0,
"records": [
{
"id": "2",
"serial": "655796682",
"duration": "2",
"filepath": "/upload/84c94d59f2c394a3fefd7570379db0df/1/user/84c94d59f2c394a3fefd7570379db0df.mp4",
"createtime": "2025-11-04 15:46:27"
}
]
}返回参数:
| 参数名 | 类型 | 说明 |
|---|---|---|
| filepath | string | 录制文件地址,需拼接录播服务器域名和端口 |
| duration | int | 时长(秒) |
错误码参考
| 错误码 | 表示 |
|---|---|
| 3001 | 服务器过期 |
| 3002 | 公司已经冻结 |
| 3003 | 会议已删除或过期 |
| 4001 | 该公司不存在 |
| 4002 | 用户名或密码错误 |
| 4003 | 会议名称不允许为空 |
| 4004 | 时间格式错误 |
| 4005 | 时间设置有误 |
| 4006 | 主席密码格式错误 |
| 4007 | 会议不存在、会议无效已被删除、会议过期 |
| 4008 | 会议密码错误 |
| 4009 | 普通用户密码格式错误 |
| 4101 | 需要验证企业 ID |
| 4102 | 验证企业 ID 错误 |
| 4103 | 会议数超过最大限制 |
| 4105 | 没有符合的数据 |
| 4106 | 会议文件数量超过数量限制 |
| 4107 | 数据库操作错误 |
| 4108 | 没有权限 |
| 4109 | Auth 不正确 |
| 4110 | 该会议需要密码,请输入密码 |
| 4111 | 非注册用户或密码不正确,该会议要求必须注册用户才能参会 |
| 4200 | 组 id 必填 |
| 4201 | 组名必填 |
| 5000 | 用户名密码必填 |
| 5001 | 会议是否有密码必填 |
| 5002 | 主席密码必填 |
| 5003 | 会议普通密码必填 |
| 5004 | 开始时间,结束时间必填 |
| 5005 | 如果允许旁听用户则应有密码 |
| 5006 | 会议普通密码格式错误 |
| 5007 | 旁听用户密码错误 |
| 5008 | 最大用户数格式错误 |
| 5009 | 最大用户数超过限制 |
| 5010 | 最大旁听用户数错误 |
| 5011 | 最大旁听用户数超过限制 |
| 5012 | 最大视频数格式错误 |
| 5013 | 最大视频数错误 |
| 5014 | 最大音频数格式错误 |
| 5015 | 最大音频数错误 |
| 5016 | 视频分辨率参数格式错误 |
| 5100 | 需要会议编号 |
| 5101 | 需要用户账号 |
| 5200 | 主席密码错误 |
| 5201 | 旁听密码错误 |
| 5203 | 普通密码 |
| 5204 | 没有密码 |
| 5205 | 昵称必填 |
| 5206 | 数据写入失败 |
| 5207 | 用户类型:0 普通交互用户,1 主席,2 旁听,3 助理,4 巡视 |
| 5208 | 用户已登陆 |
| 5300 | 登录 40 位 key 必填 |
| 5301 | 40 位 key 错误 |
| 6000 | serverid 不正确 |
| 6001 | ip 地址不正确 |
| 6002 | 普通用户数超出范围 |
| 6003 | 旁听用户数超出范围 |
| 7001 | userid 必填 |
| 7002 | accout 必填 |
| 7003 | 密码必填 |
| 7004 | 部门 ID 必填 |
| 7005 | 公司 ID 必填,缺省为 1 |
| 7006 | Accout 已经存在 |
| 7007 | 用户账号不存在 |
| 8001 | 部门 id 必填 |
| 8002 | 部门名称必填 |
| 8003 | 公司 ID 必填,缺省为 1 |
| 8004 | 父部门 ID 必填 |
| 8005 | 部门级别必填 |
| 9001 | 公司 ID 必填 |
| 9002 | 公司名必填 |
| 9003 | 电话号码或二级域名必填一个 |
| 9004 | 公司管理员 ID |
| 9006 | 该公司已经存在 |
| 9007 | 企业 ID 必填 |
| 9999 | 系统繁忙请重试 |
| 20001 | 请使用 POST 请求 |
