OA消息
请求说明
Https请求方式: POST
https://bee.quanshi.com/ucopenapi/appmsg/oa/send
给指定用户发送特定应用的OA消息;每个消息最多20个接收人、10个部门接收。消息详情请查看 OA消息设计
请求参数
{
"username": "administrator@quanshi.com",
"token": "297ba84a-ed1d-4c35-a04f-ca40d6f0946e",
"data":
{
"siteId":123123, // 所在site的ID号,默认可以不填。
"toUsers":
[
"test100.dev@quanshi.com",
"test101.dev@quanshi.com"
],
"toPartyIds":[
123,345
],
"appId": 8,
"title": "asdfasdrqwerqwer",
"color": "red",
"titleElements":[{
"stauts": 15,
"title": "asdfasdrqwerqwer",
"color": "blue",
},
{
"stauts":18,
"title": "asdfasdrqwerqwer",
"color": "red"
}],
"stauts": 0,
"elements": {},
"detailURL": "http://www.baidu.com/",
"detailAuth": 0,
}
}
参数名称 | 类型 | 可选 | 说明 |
---|---|---|---|
username | String | 选填 | 第三方应用登录,此字段不填,下面各个API接口同此定义。 |
token | String | 必填 | 登陆成功的凭证 |
data | 数据结构 | 必填 | 要发送消息的数据封装 |
data.siteId | int | 选填 | 内部应用可不填,第三方应用必填 |
data.toUsers | 字符串数组 | 选填 | 接收人数组,每条消息不能超过5个;如果接收人是”@all”, 直接向整个根部门发送消息 |
data.toPartyIds | 整形数组 | 选填 | 接收部门ID,不超过10个。接收部门和接收人不能同时为空 |
data.appId | int | 必填 | 应用服务器的ID标识,由"管理中心"提供 |
data.title | String | 必填 | 消息标题 |
data.color | String | 选填 | 消息详情内容格式1: 文件来自FS,mediaId为FS文件ID;2: 文件来自外部URL,mediaId为URL链接类型 |
data.titleElements | JSON数组 | 选填 | 定义了不同状态下标题栏对应的颜色与内容. |
data.stauts | int | 必填 | 预定义标题颜色模版名称; 可选值有:red, blue, gray, green, yellow, gray, lightblue。 |
data.elements | JSON | 必填 | OA消息元素; OA消息Elements定义 |
data.detailURL | String | 选填 | 详情URL |
data.detailAuth | int | 选填 | 打开URL方式,1: 以统一认证的方式打开; 0: 直接打开(默认) |
返回结果
{
"errorCode" : 0,
"data" :
[{
"errorCode" : 0,
"toUser" : "test100.dev@quanshi.com",
"msgId" : "xxxxx-xxxxx-xxxxxxxx-xxxxx",
"errorMessage" : null
},
{
"errorCode" : 0,
"toUser" : "test101.dev@quanshi.com",
"msgId" : "xxxxx-xxxxx-xxxxxxxx-xxxxx",
"errorMessage" : null
}],
"errorMessage" : "Successful!",
"requestId" : "9376c0d5-ae6e-4753-ba6d-3fc916ce1f4c"
}
参数名称 | 类型 | 可选 | 说明 |
---|---|---|---|
errorCode | int | 必填 | 0表示成功 |
data | 数据结构 | 必填 | 消息的每个接收主体(账号/部门)的发送结果 |
data.msgId | 数据结构 | 必填 | 返回发送OA消息的消息ID |
errorMessage | String | 必填 | 执行结果,同errorCode匹配 |
requestId | String | 必填 | 本次请求的唯一编号用 |