💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
#### 声明:WebSocket协议传输Json字符串格式,长度大小有限制 #### 接口地址:ip:端口号 格式(ws://116.255.154.75:9501) ## 用户登录: 发送报文: ``` {"page":1,"rows":50,"chatid":"3c426fa0da794c4fea42c1cede373a9c","act":"getMsg","role":"user"} ``` 接受报文: ``` {"status":1,"msg":"数据获取成功","data":[],"act":"getMsg","user":{"id":1007,"username":"李磊","password":"e10adc3949ba59abbe56e057f20f883e","fd":23,"chatid":"3c426fa0da794c4fea42c1cede373a9c","token":"513ea1c3cfda0ee648b04ae596656e1a","create_time":null,"update_time":1581659888,"nickname":"","avatar":"https://www.apicloud.com/user_icon/7d/1e/7d1ebefabddda594de237ecc1bb94cec.180x180.png","sign":"我就是我,不一样的烟火"},"kefu":{"id":10,"fd":20,"create_time":null,"update_time":1581585105,"username":"硬核编程","token":"7bafe9a2b6cf7cd8f111344bc7f1e7fa","password":"e10adc3949ba59abbe56e057f20f883e","nickname":"","avatar":"https://edu-image.nosdn.127.net/A58257D3340D71C0A61B8FC02E45E936.png?imageView&quality=100&thumbnail=90y90","sign":"","bindUserCount":2}} ``` ## 打开会话获取消息记录 发送报文 ``` {"page":1,"rows":50,"chatid":"3c426fa0da794c4fea42c1cede373a9c","act":"getMsg","role":"user"} ``` 接受报文 ``` {"status":1,"msg":"数据获取成功","data":[{"id":191,"is_read":0,"user_id":1007,"kefu_id":10,"role":"user","content":"你好?","content_type":0,"create_time":1581660061,"chatid":"3c426fa0da794c4fea42c1cede373a9c","create_time_cn":"2020-02-14 14:01:01"}],"act":"getMsg","user":{"id":1007,"username":"李磊","password":"e10adc3949ba59abbe56e057f20f883e","fd":24,"chatid":"3c426fa0da794c4fea42c1cede373a9c","token":"513ea1c3cfda0ee648b04ae596656e1a","create_time":null,"update_time":1581659888,"nickname":"","avatar":"https://www.apicloud.com/user_icon/7d/1e/7d1ebefabddda594de237ecc1bb94cec.180x180.png","sign":"我就是我,不一样的烟火"},"kefu":{"id":10,"fd":20,"create_time":null,"update_time":1581585105,"username":"硬核编程","token":"7bafe9a2b6cf7cd8f111344bc7f1e7fa","password":"e10adc3949ba59abbe56e057f20f883e","nickname":"","avatar":"https://edu-image.nosdn.127.net/A58257D3340D71C0A61B8FC02E45E936.png?imageView&quality=100&thumbnail=90y90","sign":"","bindUserCount":2}} ``` ## 发送消息 发送报文 ``` {"content":"众里寻他千百度","user_id":1007,"kefu_id":10,"role":"user","chatid":"3c426fa0da794c4fea42c1cede373a9c","act":"sendMsg"} ``` ## 客服登录 发送报文 ``` {"username":"硬核编程","password":"123456","act":"kefuLogin"} ``` 接受报文 ``` {"status":1,"msg":"登录成功","data":{"id":10,"fd":31,"create_time":null,"update_time":1581660360,"username":"硬核编程","token":"ad7eabb0f5bf904abe7805dfc90f9f53","password":"e10adc3949ba59abbe56e057f20f883e","nickname":"","avatar":"https://edu-image.nosdn.127.net/A58257D3340D71C0A61B8FC02E45E936.png?imageView&quality=100&thumbnail=90y90","sign":"","bindUserCount":2},"act":"kefuLogin"} ``` ## 获取会话列表 发送报文: ``` {"token":"75b78a2bde5e5a6e1dbd603cb53413b2","act":"getChatList"} ``` 接受报文: ``` {"status":1,"msg":"获取列表数据成功","data":[{"user_id":1002,"kefu_id":10,"chatid":"31f4a9ac8969302e8dbe326b36679c0f","username":"小明","avatar":"https://www.apicloud.com/img/signup/1-180.png","message":[]},{"user_id":1007,"kefu_id":10,"chatid":"3c426fa0da794c4fea42c1cede373a9c","username":"李磊","avatar":"https://www.apicloud.com/user_icon/7d/1e/7d1ebefabddda594de237ecc1bb94cec.180x180.png","message":{"id":192,"is_read":0,"user_id":1007,"kefu_id":10,"role":"user","content":"众里寻他千百度","content_type":0,"create_time":1581660164,"chatid":"3c426fa0da794c4fea42c1cede373a9c","create_time_cn":"2020-02-14 14:02:44"}}],"act":"getChatList"} ``` ## 打开指定会话获取消息记录 发送报文: ``` {"page":1,"rows":50,"chatid":"3c426fa0da794c4fea42c1cede373a9c","act":"getMsg","role":"kefu"} ``` 接受报文: ``` {"status":1,"msg":"数据获取成功","data":[{"id":191,"is_read":0,"user_id":1007,"kefu_id":10,"role":"user","content":"你好?","content_type":0,"create_time":1581660061,"chatid":"3c426fa0da794c4fea42c1cede373a9c","create_time_cn":"2020-02-14 14:01:01"},{"id":192,"is_read":0,"user_id":1007,"kefu_id":10,"role":"user","content":"众里寻他千百度","content_type":0,"create_time":1581660164,"chatid":"3c426fa0da794c4fea42c1cede373a9c","create_time_cn":"2020-02-14 14:02:44"}],"act":"getMsg","user":{"id":1007,"username":"李磊","password":"e10adc3949ba59abbe56e057f20f883e","fd":24,"chatid":"3c426fa0da794c4fea42c1cede373a9c","token":"513ea1c3cfda0ee648b04ae596656e1a","create_time":null,"update_time":1581659888,"nickname":"","avatar":"https://www.apicloud.com/user_icon/7d/1e/7d1ebefabddda594de237ecc1bb94cec.180x180.png","sign":"我就是我,不一样的烟火"},"kefu":{"id":10,"fd":34,"create_time":null,"update_time":1581660424,"username":"硬核编程","token":"75b78a2bde5e5a6e1dbd603cb53413b2","password":"e10adc3949ba59abbe56e057f20f883e","nickname":"","avatar":"https://edu-image.nosdn.127.net/A58257D3340D71C0A61B8FC02E45E936.png?imageView&quality=100&thumbnail=90y90","sign":"","bindUserCount":2}} ``` ## 发送消息 发送报文: ``` {"content":"那人却在灯火阑珊处","user_id":1007,"kefu_id":10,"role":"kefu","chatid":"3c426fa0da794c4fea42c1cede373a9c","act":"sendMsg"} ```