# 附录

# 消息格式

# 消息同步格式

# 消息类型

message_type 说明
1000100 文本消息上报至平台作为数据存储
1000101 Json 消息上报至平台作为数据存储
1000200 发送文本消息至其他应用系统
1000201 发送 Json 消息至其他应用系统
1000300 表示告警类消息
1000302 表示消警类消息
1000400 表示通知类消息
1000500 推送标准模型数据至微瓴平台作为数据存储,不推送给应用
1000501 推送非标准模型数据至微瓴平台,非标数据不做存储,不做转发

注:对象模型上报,不论是告警、通知、消警都统一使用1000500

# 1000100
  • 请求参数
请求参数 参数类型 参数说明
content String 消息内容
message_type number 消息类型
  • 示例
{"message_type":1000100,"content":"test content"}
1
# 1000101
  • 请求参数
请求参数 参数类型 参数说明
content json 消息内容
messag_type number 消息类型
  • 示例
{
  "message_type": 1000101,
  "content": { "key1": "val1", "key2": "val2" }
}
1
2
3
4
# 1000200
  • 请求参数
请求参数 参数类型 参数说明
to_appid String 目标 appid
msg_attribute String 消息属性。ack:根据之前的消息返回,active:主动发起
msg_id Integer 当消息属性为 ack 时,该字段为必填项,否则不用填
content String 消息内容
messag_type number 消息类型
  • 示例
{
 "message_type": 1000200,
  "to_appid": "10000",
  "msg_attribute": "ack",
 "msg_id": 85581,
 "content": "text test!"
}
1
2
3
4
5
6
7
# 1000201
  • 请求参数
请求参数 参数类型 参数说明
to_appid String 目标 appid
msg_attribute String 消息属性。ack:根据之前的消息返回,active:主动发起
msg_id Integer 当消息属性为 ack 时,该字段为必填项,否则不用填
content JsonObject 消息内容
messag_type number 消息类型
  • 示例
{
 "message_type": 1000201,
  "to_appid": "*****",
  "msg_attribute": "ack",
  "msg_id": 85581,
  "content": { "key1": "val1", "key2": "val2" }
}
1
2
3
4
5
6
7
# 1000500
  • 请求参数
请求参数 参数类型 参数说明
messag_type number 消息类型
content JsonObject 消息内容
  • 示例
{
    "message_type":1000500,
    "content":{
        "profile":{
            "modelId":1000,
            "poiCode": "t234329",
            "appType":"security_monitoring",
            "wId": "822d30b-78gv-9755-id1b-dafcsda24kih"
        },
        "reportTs":1650007523091,
        "services":{

        },
        "events":{
            "face_control":{
                "image":{
                    "data":"8bb1230b-78bb-4635-991b-9746dda24a9e",
                    "type":4
                },
                "handler":{
                    "type":0,
                    "data":"222111123123123123"
                },
                "describe":"",
                "eventType":0,
                "eventTs":1650007523091
            }
        },
        "properties":{
            "executeId":"RX_TASK"
        }
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# 1000501
  • 请求参数
请求参数 参数类型 参数说明
messag_type number 消息类型
content JsonObject 消息内容
  • 示例
{
 "message_type": 1000501,
  "content": { "key1": "val1", "key2": "val2" }
}
1
2
3
4
#

# 回复推送消息

  • 收到推送消息后,需要回复一个 json 格式如下
请求参数 参数类型 参数说明
code number 回复为 0
cookie String 推送报文中的 cookie
  • 示例
// mvs 推送的消息为
// 注意这里的cookie需要回复给接收端
{
  "apiName": "report_data_point",
  "cookie": "16198_577418",
  "wId": "********",
  "errmsg": "",
  "id": 20134,
  "time": 1511802600575,
  "type": "string",
  "value":"{\"V\":1,\"subid\":\"0900009\",\"list\":[{\"func\":\"CO2\",\"value\":\"972180.00\"}],\"timestamp\":1511802557768}",
  "seq": "0"
}
//接收方应该回复
{ "code": 0, "cookie": "16198_577418" }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15