查询消息列表[数字工厂]

最近更新时间:8/3/2022, 11:08:41 AM作者:andrewren(任豪)

查询消息列表

本接口用于查询消息列表。

接口请求域名 http://iam-api.{工业环境域名}

接口类型:OpenAPI

接口请求方式:POST

接口名:GetMsgList

输入参数

参数名称 必选 类型 描述
Action String openapi公共参数,本接口取值:GetMsgList
Receivers Array of String 消息接受者数组,可传入多个accountId
Offset Integer 分页参数,偏移量,默认0
Limit Integer 分页参数,限制数目,默认为100
Sorts Array of Object 排序参数
Sorts.name Integer 目前仅支持按创建时间排序,传create_time
Sorts.order_by String 传acs升序) 或者desc(降序)

输出参数

Response

参数名称 类型 描述
RequestId String 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId
Data Object 消息体
Code Integer 错误码,0表示成功
total Integer 消息总数
unreadNum Integer 未读消息数量
Infos Array of Object 消息列表
MsgID string 消息唯一ID
Source Integer 消息来源ID
SourceStr String 消息来源名称
MsgType Integer 消息类型,0表示通知,1表示待办
MsgTypeStr String 消息类型名称,可取值通知、待办
Title String 消息标题
IsRead Integer 消息阅读状态,0表示未读,1表示已读
CreateTime Integer 消息发送时间戳

示例

输入示例

{
  "Receivers": [
    "159xxxxxxx"
  ],
  "Sorts": [
    {
      "Name": "create_time",
      "OrderBy": "desc"
    }
  ],
  "Offset": 0,
  "Limit": 0
}

输出示例

{
"RequestId": "9916779b-3f34-4929-9e8c-9cb364c7a1a4",
"Data": {
"Code": 0,
"total": 2,
"unreadNum": 0,
"Infos": [
{
"MsgID": "1037678030060782200",
"Source": 1030,
"SourceStr": "产品与服务",
"MsgType": 0,
"MsgTypeStr": "通知",
"Title": "采购单号入库成功通知",
"IsRead": 1,
"CreateTime": 1657520953
},
{
"MsgID": "1037598521810748000",
"Source": 1030,
"SourceStr": "产品与服务",
"MsgType": 0,
"MsgTypeStr": "通知",
"Title": "采购单号入库成功通知",
"IsRead": 1,
"CreateTime": 1657511015
}
]
}
}

已读消息

本接口用于将消息状态置为已读。

接口请求域名 http://iam-api.{工业环境域名}

接口类型:OpenAPI

接口请求方式:POST

接口名:ReadMsg

输入参数

参数名称 必选 类型 描述
Action String openapi公共参数,本接口取值:GetMsgList
Reciver String 消息接收者AccountId
MsgIds Array of String MsgId 列表,数量限制不超过100个

输出参数

Response

参数名称 类型 描述
RequestId String 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId
Msg String 错误信息
Code Integer 错误码,0表示成功

示例

输入示例

{
  "Reciver": "159xxxxxxx",
  "MsgIds": [
    "1038363178989257324"
  ]
}

输出示例

{
  "Code": 0,
  "Msg": "success",
  "RequestId": "1b8a770e-c79b-48d2-b1ce-d0a59c402389"
}

消息通知

{
  "MsgType": "MSG",
  "AccountIds": [
    "511008144529233333"
  ],
  "Operation": "READ",
  "MsgIds": [
    "1038366773012857452"
  ]
}