Skip to content

更新审批模版

用于更新轻审批模版的场景

请求说明

请求地址配置域名+/o/woa/api/v2/workflow/developer/condition/templates/
请求方法PUT
签名方式wps-4
支持应用类型企业自建应用、第三方企业应用
权限要求更新审批模版信息(kso.workflow.template.write)

请求头

Header名称是否必填说明
Content-Type目前固定为:"application/json"
Wps-Docs-Date取当前时间, 示例: Wed, 23 Jan 2013 06:43:08 GMT
Wps-Docs-Authorization计算方法参考签名说明
Authorizationaccess_token(企业授权获取的token)

请求地址示例

http
[PUT] 配置域名+/o/woa/api/v2/workflow/developer/condition/templates/YWEAMK0DkP1vV0Napq74QJzXLx?operator=1233

查询参数(path)

名称类型是否必填说明
template_codestring模版code

查询参数(Query)

名称类型是否必填说明
operatorint操作人(wpsUid)

请求体(Body)

参数类型是否必填说明
namestring模板名称
group_idint模板组id
iconstring模板组图标(暂不开放编辑,固定tmp15)
visible_scopes[]object模版可见范围
 ∟ corpidlong企业id
 ∟ partidlong部门id (可见范围是部门时,赋值)
 ∟ useridlong用户id,wpsUid (可见范围是用户时,赋值)
managers[]object模版管理员集合
 ∟ corpidlong管理员所在企业id
 ∟ useridlong管理员用户id,wpsUid
content[]object模板设置的内容,包含各种前端控件属性
 ∟ idint表单字段序号
 ∟ requiredbool是否必填(true:必填,false:非必填)
 ∟ not_printbool是否参与打印(true:是,false:否)
 ∟ titlestring控件对应的标题
 ∟ typeint控件类型,枚举如下:(1. 单行文本2. 多行文本3. 文件文本4. 富文本5. 日期6. 单选7. info信息8. 联系人9. 多选10. 数字11. 金额12.图片组件)
 ∟ placeholderstring文本控件提示
 ∟ dateplacestring日期控件提示
 ∟ timeplacestring时间控件填写提示
 ∟ timestring时间控件对应的名称
 ∟ datestring日期控件对应的名称
 ∟ stepstring步长(时间选择器用的,比如步长是15 ,只能选10:15 10:30 10:45)
 ∟ bodystring富文本控件内容
 ∟ options[]object多选下拉框数组
   ∟ commandint选项ID
   ∟ txtstring选项内容
 ∟ select_valuestring下拉框控件对应的选项值,非必传
 ∟ extrastring额外配置参数,方便扩展,服务端仅提供存储(如:{"not_print":false})
flow_data[]object模板流程设置的数据流,包含节点配置信息
 ∟ idint流程节点id
 ∟ node_typeint流程节点类型 1:审批 2:抄送
 ∟ titlestring流程节点名称
 ∟ select_typeint用户个数类型 1:单选 2:多选
 ∟ user_typeint用户类型 0:指定成员 1:发起人自选,3:上级,4:连续多级上级,5:部门负责人,6:连续多级部门负责人
 ∟ all_user_dismissint所有审批用户离职采取操作 1:转交模板管理员 2:自动审批通过
 ∟ ruleint审批规则:0 逐级审批 1 会签 2 或签
 ∟ add_more_copyersint允许继续添加抄送人(抄送节点user_type=0时有效。 1为允许添加,0不允许)
 ∟ levelint指定层级(可选范围:0~9)
 ∟ sourceint节点来源(区分是否来自于加签,0正常流程创建,1加签)
 ∟ members[]long审批或抄送用户成员
 ∟ lines[]object分支节点数组(无分支节点可不传)
   ∟ line_idint条件节点虚拟id
   ∟ priorityint优先级
   ∟ flows[]object子节点数组(数据结构与上层的flow_data结构一致)
 ∟ conditionsmap分支节点数组(无分支节点可不传)
   ∟ keyint分支编号
   ∟ valueobjectmap的value
     ∟ idlong条件分支id
     ∟ Typeint条件分支类型
     ∟ Ruleint条件分支规则
     ∟ Titlestring条件分标题
     ∟ Valueobject任意对象,单选、多选、金额、字符串

请求体示例

json
{
  "name": "dev-test测试1",
  "group_id": 1,
  "visible_scopes": [
    {
      "corpid": 1,
      "userid": 1028
    },
    {
      "corpid": 1,
      "userid": 1029
    },
    {
      "corpid": 1
    }
  ],
  "managers": [
    {
      "corpid": 1,
      "userid": 1028
    }
  ],
  "content": [
    {
      "body": "",
      "date": "",
      "dateplace": "",
      "id": 0,
      "not_print": false,
      "options": null,
      "placeholder": "",
      "required": false,
      "select_value": "",
      "step": "",
      "time": "",
      "timeplace": "",
      "title": "单行文本",
      "type": 1,
      "extra": "{\"not_print\":false}"
    }
  ],
  "flow_data": [
    {
      "id": 2,
      "node_type": 1,
      "title": "审批",
      "select_type": 1,
      "user_type": 1,
      "all_user_dismiss": 1,
      "rule": 0,
      "add_more_copyers": 0,
      "source": 0,
      "approvers": [],
      "lines": [
        {
          "line_id": 5,
          "priority": 1,
          "flows": [
            {
              "id": 6,
              "node_type": 5,
              "title": "条件1",
              "select_type": 0,
              "select_range": 0,
              "user_type": 0,
              "all_user_dismiss": 1,
              "rule": 0,
              "add_more_copyers": 0,
              "source": 0,
              "lines": null,
              "conditions": [
                [
                  {
                    "id": -1,
                    "type": 13,
                    "rule": 1,
                    "value": { "depts": [], "users": [] }
                  }
                ]
              ]
            }
          ]
        }
      ]
    }
  ]
}

响应体

名称类型说明
resultstringok:成功,其他-失败
msgstring错误信息

响应体示例

json
{
  "result": "ok",
  "msg": "success"
}