消息

1. 发送消息

1.0.1. 地址

http://domain:18080/admin/message/send

1.0.2. body

参数 类型 必需 描述
sender string 发送者ID
conv json 会话
payload json 消息负载
toUsers string[] 群组或者频道中发给指定用户

1.0.3. 响应

参数 类型 必需 描述
messageUid long 消息唯一ID
timestamp long 服务器处理时间

1.0.4. 示例

curl -X POST -H "nonce:76616" -H "timestamp":"1558350862502" -H "sign":"b98f9b0717f59febccf1440067a7f50d9b31bdde" -H "Content-Type:application/json" -d   \
  "{                       \
    \"sender\":\"a\",       \
    \"conv\": {              \
      \"type\":1,            \
      \"target\":\"a\",      \
      \"line\":0,           \
    },                        \
    \"payload\":{                 \
      \"type\":1,                       \
      \"searchableContent\":\"hello\"   \
    }                                   \
  }"                                \
  http://localhost:18080/admin/message/send

{
  "code":0,
  "msg":"success",
  "result":{
    "messageUid":5323423532,
    "timestamp":13123423234324,
  }
}

2. 撤回消息

2.0.1. 地址

http://domain:18080/admin/message/recall

2.0.2. body

参数 类型 必需 描述
operator string 撤回者
messageUid long 消息唯一ID

2.0.3. 响应

N/A

2.0.4. 示例

curl -X POST -H "nonce:76616" -H "timestamp":"1558350862502" -H "sign":"b98f9b0717f59febccf1440067a7f50d9b31bdde" -H "Content-Type:application/json" -d "{\"operator\":\"a\",\"messageUid\":5323423532}" http://localhost:18080/admin/message/recall

{
  "code":0,
  "msg":"success",

}

3. 组播消息

3.0.1. 地址

http://domain:18080/admin/message/multicast

3.0.2. body

参数 类型 必需 描述
sender string 发送者ID
targets list 接收者ID列表
line int 会话线路,缺省为0
payload json 消息负载

3.0.3. 响应

参数 类型 必需 描述
messageUid long 消息唯一ID
timestamp long 服务器处理时间

3.0.4. 示例

curl -X POST -H "nonce:76616" -H "timestamp":"1558350862502" -H "sign":"b98f9b0717f59febccf1440067a7f50d9b31bdde" -H "Content-Type:application/json" -d   \
  "{                       \
    \"sender\":\"a\",       \
    \"targets\": [\"userId1\",\"userId2\"],                        \
    \"payload\":{                 \
      \"type\":1,                       \
      \"searchableContent\":\"hello\"   \
    }                                   \
  }"                                \
  http://localhost:18080/admin/message/multicast

{
  "code":0,
  "msg":"success",
  "result":{
    "messageUid":5323423532,
    "timestamp":13123423234324,
  }
}

4. 广播消息(仅专业版支持)

4.0.1. 地址

http://domain:18080/admin/message/broadcast

4.0.2. body

参数 类型 必需 描述
sender string 发送者ID
line int 会话线路,缺省为0
payload json 消息负载

4.0.3. 响应

参数 类型 必需 描述
messageUid long 消息唯一ID
count int 发送对象数目

4.0.4. 示例

curl -X POST -H "nonce:76616" -H "timestamp":"1558350862502" -H "sign":"b98f9b0717f59febccf1440067a7f50d9b31bdde" -H "Content-Type:application/json" -d   \
  "{                       \
    \"sender\":\"a\",       \                       \
    \"payload\":{                 \
      \"type\":1,                       \
      \"searchableContent\":\"hello\"   \
    }                                   \
  }"                                \
  http://localhost:18080/admin/message/broadcast

{
  "code":0,
  "msg":"success",
  "result":{
    "messageUid":5323423532,
    "count":130002
  }
}

5. 删除消息(仅专业版支持)

5.0.1. 地址

http://domain:18080/admin/message/delete

5.0.2. body

参数 类型 必需 描述
messageUid long 消息唯一ID

5.0.3. 响应

N/A

5.0.4. 示例

curl -X POST -H "nonce:76616" -H "timestamp":"1558350862502" -H "sign":"b98f9b0717f59febccf1440067a7f50d9b31bdde" -H "Content-Type:application/json" -d   \
  "{                       \
    \"messageUid\":123413241234123       \
  }"                                \
  http://localhost:18080/admin/message/broadcast

{
  "code":0,
  "msg":"success"
}
2018 © wildfirechat.net 京ICP备18060403号-1 all right reserved,powered by Gitbook该文件修订时间: 2022-08-29 09:42:41

results matching ""

    No results matching ""