[关闭]
@chenwei123 2016-05-19T08:57:02.000000Z 字数 1723 阅读 454

融云

美音


1. 获取rong_token

Description

用户获取token值

Method and URL Structure

Method Resource URL
GET /im/user_get_token/

Request Parameters

Name Description Required Default
username 用户账号 Yes
password 密码 Yes

URL Example

  1. http://127.0.0.1:8000/im/user_get_token/?username=student1&password=123456

JSON Response

  1. {
  2. "reason": "",
  3. "token": "LhgktowfANuVJlWPhX+ZRsBOgTIO/YpEIMYDHwEVz47SdCVKMAeVm2e4C1X17UemEq0fkmzYt4FSiJIgc4iEeOqTkNfu0ymd",
  4. "ret": "success"
  5. }

2. 创建聊天室

Description

用户创建聊天室

Method and URL Structure

Method Resource URL
GET /im/chatroom_create/

Request Parameters

Name Description Required Default
username 用户账号 Yes
password 密码 Yes
live_id 直播课程id Yes
name 聊天室的名称 Yes

URL Example

  1. http://127.0.0.1:8000/im/chatroom_create/?username=teacher1&password=123456&live_id=1&name=room1

JSON Response

  1. {
  2. "reason": "",
  3. "id": 7,
  4. "ret": "success"
  5. }

3. 加入聊天室

Description

用户加入聊天室

Method and URL Structure

Method Resource URL
GET /im/chatroom_join/

Request Parameters

Name Description Required Default
username 用户帐户 Yes
password 密码 Yes
id 聊天室id Yes

URL Example

  1. http://127.0.0.1:8000/im/chatroom_join/?username=student1&password=123456&id=7

JSON Response

  1. {"reason": "", "ret": "success"}

4.销毁聊天室

Description

销毁聊天室

Method and URL Structure

Method Resource URL
GET /im/chatroom_destroy/

Request Parameters

Name Description Required Default
username 用户帐户 Yes
password 密码 Yes
id 聊天室id Yes

URL Example

  1. http://127.0.0.1:8000/im/chatroom_destroy/?username=teacher1&password=123456&id=1

JSON Response

  1. {"reason": "", "ret": "success"}

5.查询聊天室信息

Description

查找聊天室

Method and URL Structure

Method Resource URL
GET /im/chatroom_query/

Request Parameters

Name Description Required Default
username 用户帐户 Yes
password 密码 Yes
id 聊天室id Yes

URL Example

  1. http://127.0.0.1:8000/im/chatroom_query/?username=teacher1&password=123456&id=7

JSON Response

  1. {
  2. "item":
  3. {
  4. "chatroom_id": 7,
  5. "name": "room7",
  6. "time": "2016-05-17T10:45:07.779"
  7. },
  8. "reason": "",
  9. "ret": "success"
  10. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注