Skip to content

发起审批

新建审批单

请求说明

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

请求头

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

请求地址示例

http
[POST] 配置域名+/o/woa/api/v2/workflow/developer/condition/approvals?operator=

查询参数(Query)

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

请求体(Body)

参数类型是否必填说明
template_codestring模板混淆id
namestring审批单名称
current_approverint当前审批人id
content[]object审批单内容
 ∟ typeint控件类型,枚举如下:(1. 单行文本2. 多行文本3. 文件文本4. 富文本5. 日期6. 单选7. info信息8. 联系人9. 多选10. 数字11. 金额12.图片组件)
 ∟ titlestring控件标题
 ∟ textstring控件内容
 ∟ not_printbool是否参与打印(true:是,false:否)
attachments[]object附件列表
 ∟ fileidstring云文档文件id
 ∟ namestring附件名称
 ∟ typeint附件类型,1-审批内容附件,2-评论附件,3-审批内容图片,4-评论区图片附件
 ∟ store_typeint存储类型,1-云存储,2-云文档
 ∟ store_keystring云存储key
 ∟ storestring存储端的名称,例如ks3
 ∟ thumb_store_keystring存储key
flow_data[]object流程节点
 ∟ idint模板流程设置的数据流,包含节点配置信息
 ∟ 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不允许)
 ∟ sourceint节点来源(区分是否来自于加签,0正常流程创建,1加签)
 ∟ approvers[]long审批用户成员
 ∟ copyers[]long抄送人id数组
remindint是否发送提醒给审批人,1-发送提醒,0-不发送

请求体示例

json
{
  "template_code": "r38urhy2837r2832ere",
  "name": "admin提交的开放test2",
  "remind": 1,
  "content": [
    {
      "type": 1,
      "title": "单行文本",
      "not_print": false,
      "text": "单行文本",
      "attachments": []
    },
    {
      "type": 12,
      "title": "图片",
      "not_print": false,
      "text": "",
      "attachments": [
        {
          "name": "2776623f7212378957e43f821847c59e.jpeg",
          "type": 3,
          "store_type": 1,
          "size": 96684,
          "store": "ks3",
          "store_key": "DD1AFB2xxx",
          "thumb_store_key": "DD1AFB2xxx"
        }
      ]
    },
    {
      "type": 4,
      "title": "富文本",
      "not_print": true,
      "text": "<p><a href=\"https://kdocs.cn/l/cxxx\" rel=\"noopener noreferrer\" target=\"_blank\">【金山文档】 开放平台轻审批接口</a></p><p><br></p>",
      "attachments": []
    }
  ],
  "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": [123]
    },
    {
      "id": 3,
      "node_type": 2,
      "title": "抄送",
      "select_type": 1,
      "user_type": 1,
      "all_user_dismiss": 1,
      "rule": 0,
      "add_more_copyers": 1,
      "source": 0,
      "copyers": [234]
    }
  ]
}

响应体

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

响应体示例

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