应用可以把需要用户处理的业务信息通过待办的方式推送到消息列表,用户点击待办消息后可以进入对应的应用中完成处理。
接口价值: 实现在待办通知中集中呈现需要用户及时处理的业务消息,避免遗漏。
准入标准: 用户需要及时查看处理的,并且处理能推动业务的应用消息才可以推送到待办通知。例如会议通知、审批通知。
使用示例:

云之家待办消息接口都需要通过云之家OAuth2.0授权协议进行授权,授权级别为app级,授权方式为在接口请求URL后面添加accessToken参数,例如https://www.yunzhijia.com/gateway/openimport/open/...?accessToken=xxxxxx
HTTPS
https://www.yunzhijia.com
POST
Content-Type: application/json
描述: 发送待办消息
URL: /gateway/newtodo/open/generatetodo.json?accessToken=xxxxxxxxx
输入参数:
| 字段 | 类型 | 是否必填 | 说明 |
|---|---|---|---|
| url | String | 是 | 点击待办跳转的URL |
| sourceId | String | 是 | 生成的待办所关联的第三方服务业务记录的ID,待办的批次号,对应待办处理中的sourceitemid |
| content | String | 否 | 待办内容 |
| title | String | 是 | 来自字段的内容显示 |
| itemtitle | String | 否 | 待办项标题内容显示,选填,如不填,则默认为title值 |
| headImg | String | 是 | 待办在客户端显示的图URL |
| appId | String | 是 | 生成的待办所关联的第三方服务类型ID,appId和sourceId组合在一起标识云之家唯一的一条待办 |
| senderId | String | 否 | 待办的发送人的openId |
| DO | Integer | 否 | 目标处理状态,0表示未办,1表示已办,默认为0 |
| READ | Integer | 否 | 目标读状态,0表示未读,1表示已读,默认为0 |
| openId | String | 是 | 待办接受人ID,可填多人 |
JSON示例:
{
"content": "成建蒋的请假单据需要您审批",
"title": "待办测试",
"itemtitle":"请假审批",
"headImg": "https://www.yunzhijia.com/space/c/photo/load?id=5a2f7ad750f8dd7810e79981",
"appId": "500041933",
"senderId": "5a41b292e4b058cf3d0cf314",
"params": [{
"status": {
"DO": 0,
"READ": 0
},
"openId": "5a39c75ae4b0a5d9edbf1d67"
},
{
"status": {
"DO": 0,
"READ": 0
},
"openId": "5a41b292e4b058cf3d0cf314"
}],
"url": "http://www.baidu.com",
"sourceId": "jzyj2eeappdemo"
}
输出结果:
{
"error": "",
"data": {},
"errorCode": 0,
"success": "true"
}
成功示例:

描述: 变更待办消息的处理状态、读状态、删除状态。
请求地址: /gateway/newtodo/open/action.json?accessToken=xxxxxxxxx
输入参数:
JSON示例:
{
"sourceitemid": "12345678",
"sourcetype": "500041933",
"actiontype": {
"deal": 0,
"read": 0
},
"openids": ["5a41b292e4b058cf3d0cf313","5a39c75ae4b0a5d9edbf1d62"]
}
| 字段 | 类型 | 是否必填 | 说明 |
|---|---|---|---|
| sourcetype | String | 是 | 应用ID,即appId |
| sourceitemid | String | 是 | 即发送待办的sourceId,生成的待办所关联的第三方服务业务记录的ID,是待办的批次号 |
| deal | Integer | 否 | 目标处理状态,0表示未办,1表示已办,默认为0 |
| read | Integer | 否 | 目标读状态,0表示未读,1表示已读,默认为0 |
| delete | Integer | 否 | 目标删除状态,0表示未删除,1表示已删除 |
| openids | String | 否 | 可填多人,不填则更改sourceitemid下所有人员的待办状态 |
输出结果:
{
"error": "",
"data": {},
"errorCode": 0,
"success": "true"
}
描述: 待办消息发送确认
请求地址: /gateway/newtodo/open/checkcreatetodo.json?accessToken=xxxxxxxxx
JSON示例:
{
"sourceitemid": "12345678",
"sourcetype": "500041933",
"openId": "5a41b292e4b058cf3d0cf313"
}
| 字段 | 类型 | 是否必填 | 说明 |
|---|---|---|---|
| sourcetype | String | 是 | 应用ID,即appId |
| sourceitemid | String | 是 | 即sourceId,生成的待办所关联的第三方服务业务记录的ID,是待办的批次号 |
| openId | String | 是 | 待办接受人ID |
输出结果:
{
"data": {
"sourceid": "12345678",
"appid": "500041933",
"check": true,
"dealCount": 0,
"undelCount": 1
},
"success": "true",
"errorCode": 0,
"error": ""
}
| 字段 | 类型 | 说明 |
|---|---|---|
| appid | String | 对应请求参数中的sourcetype |
| sourceid | String | 对应请求参数中的sourceitemid |
| check | boolean | 检查结果,true:成功,false:失败 |
| dealCount | int | 表示生成已办成功的数量 |
| undelCount | int | 表示变已办成功的数量 |
待办:
dealCount=0,undelCount=0:表示待办生成失败
dealCount=0,undelCount=1:表示待办生成成功
dealCount=1,undelCount=0:表示待办已经变已办了
已办:
dealCount=0,undelCount=1:表示变已办失败
dealCount=1,undelCount=0:表示变已办成功
暂无