Skip to content

消息操作

当消息中wfr为true时,支持对这个消息内容进行操作,可实现如审批驳回等操作。

API

请求地址为: {你的API地址}/message/action

请求参数

名称类型说明
idint消息ID
commandstring动作名称,resolve 或 reject。
resolve 为确认动作,如审批、通过等。
reject 为驳回动作,如取消、驳回等。

返回参数

名称类型说明
errorstring操作错误提示内容,如可能出现的权限不足等提示。
resultstring返回处理的结果

接口示例

php
<?php
$json_data = file_get_contents('php://input');
$data_array = json_decode($json_data, true);
$id = (int)$data_array['id'];
$command = $data_array['command'];
$result = $command == 'resolve' ? '审批结果:同意。(By 张总)' : '审批结果:驳回。(By 李经理)';
echo json_encode([
    'error' => '', 
    'result' => $result
], 256);