通用API

1. 创建/更新频道

频道是一种一对多的关系,类似于微信公众号,使用server api创建完频道后,可以使用channel api进行对接业务系统。

1.0.1. 地址

http://domain:18080/admin/channel/create

1.0.2. body

参数 类型 必需 描述
owner string 频道拥有者
name string 频道名称
targetId string 频道ID,如果传空,系统会自动生成一个用户id
callback string 频道消息回调地址
portrait string 频道头像
auto int 0,owner会接收到消息,如果配置callback同时会转发消息;1,owner不会接收消息,如果配置callback会转发消息到callback
desc string 描述信息
state int 频道权限
secret string 频道密钥,如果为空系统会自动生成
extra string 附加信息

1.0.3. 响应

参数 类型 必需 描述
targetId string 频道ID
secret string 频道密钥

如果创建时不填写secret,会自动生成一个

1.0.4. 示例

curl -X POST -H "nonce:76616" -H "timestamp":"1558350862502" -H "sign":"b98f9b0717f59febccf1440067a7f50d9b31bdde" -H "Content-Type:application/json" -d "{\"name\":\"a\",\"callback\":\"http://localhost/admin\",\"owner\":\"b\"}" http://localhost:18080/admin/channel/create

{
  "code":0,
  "msg":"success",
  "result":{
    "targetId":"a",
    "secret":"xxxxx"
  }
}

2. 创建/更新机器人

创建/更新机器人

2018 © wildfirechat.net 京ICP备18060403号-1 all right reserved,powered by Gitbook该文件修订时间: 2022-04-28 11:26:28

results matching ""

    No results matching ""