URI:http://172.16.1.40:8080
HTTP头:Content-Type: application/json
响应说明:基于Response Code来判断接口成功与否,200-299表明成功,300以上表明失败,400以上表明客户端异常,500以上表明服务端异常 css
API规范: 基于access_token机制前端
请求的URL后面都必须带上参数access_token, 不须要受权的接口除外,access_token在用户认证成功后返回(不走浏览器session机制)json
防篡改机制:MD5+key浏览器
添加到header里面,key为hashsession
URI:/token
HTTP方法:POST
请求实体:架构
{ "userId": "8e4eca6bb62a4caea183ce66a2768682", "name": "张三", "avatar": "xxxxx", "orgId": "108f826f-4a36-4742-a124-6ade824c85ed", "ticket": "bebd9c2dc5c943249b7ddc211f7d02d3", "domainId": "atwork" }
响应实体:app
{ "access_token": "1ad88f34090b46498e96c21ba858e7dd", "organizations": [{ "name": "恒拓高科", "avatar": "", "orgId": "" }], "avatar": "", "name": "" }
步骤:dom
生成二维码url
定时轮询查看状态设计
URI:
HTTP方法:GET
请求实体:
{ "qrcode": "图片base64" }
URI:
HTTP方法:POST
请求实体:
{ "username": "15912345678", "password": "xxxxx" }
响应实体:
URI:/token
HTTP方法:POST
请求实体:
{ "userId": "8e4eca6bb62a4caea183ce66a2768682", "name": "张三", "avatar": "xxxxx", "orgId": "108f826f-4a36-4742-a124-6ade824c85ed", "ticket": "bebd9c2dc5c943249b7ddc211f7d02d3", "domainId": "atwork" }
响应实体:
{ "access_token": "1ad88f34090b46498e96c21ba858e7dd", "organizations": [{ "name": "恒拓高科", "avatar": "", "orgId": "" }], "avatar": "", "name": "" }
URI:/repository/process-categories/
HTTP方法:POST
请求实体:
{ "name": "分类1", "parentId": "xxxxx" }
响应实体:
{}
URI:/repository/process-categories/:id
HTTP方法:PUT
请求实体:
{ "name": "分类1" }
响应实体:
URI:/repository/process-categories/:id
HTTP方法:DELETE
响应实体:
URI:/repository/process-categories/
HTTP方法:GET
响应实体:
{ "data": [{ "id": "", "name": "", "children": [{ }] }] }
URI:/repository/process-definitions
HTTP方法:GET
参数说明:
category: 流程分类,不传时默认查询全部 suspended: 是否挂起,默认false startableByUser: 筛选某个用户有权限发起的流程
响应实体:
{ "data": [{ "id": "xxxx", "key": "", "name": "请假流程", "icon": "", "suspended": false, // 是否挂起 "creator": "建立者", "instanceCount": 88, "lastUpdated": "毫秒数" // 最后更新时间 }] }
URI:/repository/process-definitions/:id
HTTP方法:PUT
请求实体:
{ "category": "categoryId" }
响应实体:
{ }
URI:/repository/process-definitions/:id
HTTP方法:DELETE
URI:/repository/process-definitions/:id
HTTP方法:PUT
请求实体:
{ "action" : "activate" }
URI:/repository/process-definitions/:id
HTTP方法:PUT
请求实体:
{ "action" : "suspend" }
URI:/repository/process-definitions/
HTTP方法:POST
请求实体:
{ "name": "请假流程", "category": "categoryId", "description": "description", "icon": "mediaId" }
响应实体:
{ }
URI:/repository/free-process-definitions/
HTTP方法:POST
请求实体:
{ "name": "请假流程", "category": "categoryId", "description": "description", "icon": "mediaId" }
响应实体:
{}
URI:/repository/process-definitions/:id
HTTP方法:GET
响应实体:
{ "id": "xxxx", "name": "请假流程", "suspended": false, // 是否挂起 "creator": "建立者", "instanceCount": 88, "lastUpdated": "毫秒数" // 最后更新时间 }
URI:/repository/process-forms/
HTTP方法:POST
请求实体:
{ "components": [], // 组件 "css": {}, "description": "description" }
响应实体:
{}
URI:/repository/deployements
HTTP方法:POST
请求实体:
{ }
响应实体:
{}
URI:/process-settings/:id
HTTP方法:PUT
请求实体:
{ "suspended": false, "sn": "'abc' + date + sn(6)", "starterScope": { "orgs": ["xxx"], "users": ["xxx"] }, "category": "", "icon": "" }
响应实体:
{}
URI:/repository/process-datas/:key
HTTP方法:GET
参数说明:
按提交日期筛选:createdFrom=2017-01-01, createdTo=2017-01-30 按部门筛选: orgId 按选项筛选: field_:id=value, field_:id=[] 分页: start=0, limit=20
响应实体:
{ "data": [{ "id: "", "sn": "", "starter": "", "starterOrg": "", "starterJob": "", "created": "", "status": "", "finished": "", "field": [{ id: value }], "handingInfo": [{ "approver": "", "handleTime": "", "content": "" }] 节点1意见、节点1结果、节点1签名、节点1时间……节点N意见、节点N结果、节点N签名、节点N时间 }] }
URI:/data/process-instances/:id
HTTP方法:DELETE
URI:/data/process-exports/:id
HTTP方法:GET
URI:/orginisation/orgs/:id/tree
HTTP方法:GET
响应实体:
{ "data": [{ "id": "", "name": "", "children": [{}], "initiated": false }] }
URI:/orginisation/orgs/:id/members
HTTP方法:GET
参数说明: recursive=true 是否包含子部分红员 keyword=用户名或者姓名 start=0 limit=20
响应实体:
{ "data": [{ "userId": "", "name": "", "job": "", "avatar": "" }] }
URI:/orginisation/roles?zoneId=:orgId
HTTP方法:POST
请求实体:
{ "name": "", "description": "" }
响应实体:
{ }
URI:/orginisation/roles/:id
HTTP方法:PUT
请求实体:
{ "name": "", "description": "" }
响应实体:
{ }
URI:/orginisation/roles/:id
HTTP方法:DELETE
URI:/orginisation/roles?zoneId=:orgId
HTTP方法:GET
响应实体:
{ "data": [{ "id": "", "name": "", "description": "", "inherited": false }] }
说明:
机构负责人和分管领导是每一个组织默认都有的角色,org-leader和org-superior
URI:/orginisation/role-settings/
HTTP方法:PUT
请求实体:
{ "inherit": true }
响应实体:
{ }
URI:/orginisation/role-assignments?orgId=:orgId
HTTP方法:GET
响应实体:
{ "data": [{ "role": { "id": "", "name": "", }, "user": { "id": "", "name": "", } }] }
URI:/orginisation/role-assignments?orgId=:orgId
HTTP方法:PUT
请求实体:
[{ "role": { "id": "", "name": "", }, "user": { "id": "", "name": "", } }]
响应实体:
{ }
URI:/orginisation/zones/:id
HTTP方法:GET
响应实体:
{ "data": [{ "orgId": "", "admins": [{ "id": "", "name": "" }] }] }
URI:/orginisation/zones/
HTTP方法:POST/PUT
请求实体:
{ "orgId": "", "admins": ["", ""] }
响应实体:
{ }
URI:/files/
HTTP方法:POST
HTTP请求头:Content-Type: multipart/form-data
请求实体:
{ "file": "" }
响应实体:
{ "mediaId": "", "name": "", "size": "" }
URI:/files/:id
HTTP方法:GET
响应实体:
{ "url": "" }
前端实现
URI:
HTTP方法:GET
响应实体:
{ }
前端实现
URI:/repository/process-definitions/
HTTP方法:GET
请求参数:
startableByUser, 用户ID zoomId, 组织ID
响应实体:
{ "data": [{ "id": "xxxx", "key": "", "name": "请假流程", "icon": "" }] }
URI:/repository/process-definitions/:id
HTTP方法:GET
响应实体:
{ "components": [], "type": "", "name": "", "id": "", "version": "", "key": "", "comments": [], "approveInfo": [] }
URI:/runtime/process-instances
HTTP方法:POST
请求实体:
{ "processDefinitionId": "key:version:xx", "components": [], "starter": "", "orgId": "" }
响应实体:
{ }
URI:/runtime/process-instances-draft
HTTP方法:POST
请求实体:
{ "processDefinitionId": "key:version:xx", "components": [], "starter": "", "orgId": "" }
响应实体:
{ }
URI:/runtime/process-comments?instanceId=?
HTTP方法:POST
请求实体:
{ "content": "", "notify": [""], "image": [] "attachment": [] }
响应实体:
{ }
URI:/runtime/tasks/:id
HTTP方法:POST
请求实体:
{ "action" : "agree", "mediaId": "", "content": "" }
响应实体:
{ }
URI:/runtime/tasks/:id
HTTP方法:POST
请求实体:
{ "action" : "agree", "mediaId": "", "content": "", "nextApprovers": [""], "finish": true }
响应实体:
{ }
URI:/runtime/tasks/:id
HTTP方法:POST
请求实体:
{ "action" : "refuse", "content": "" }
响应实体:
{ }
URI:/runtime/tasks/:id
HTTP方法:POST
请求实体:
{ "action" : "fallback", "to": "previous/starter", "content": "" }
响应实体:
{ }
URI:/runtime/tasks/:id
HTTP方法:POST
请求实体:
{ "action": "withdraw" }
响应实体:
{ }
URI:/runtime/tasks/:id
HTTP方法:POST
请求实体:
{ "action": "prompt" }
响应实体:
{ }
URI:/runtime/tasks/:id
HTTP方法:POST
请求实体:
{ "action": "notify" }
响应实体:
{ }
URI:/runtime/tasks/
HTTP方法:GET
请求参数:
candidateUser候选人 keyword start=0 limit=20 owner=userId
响应实体:
{ "data": [{ "name": "", "creater": "", "sn": "", "taskId": "", "createTime": "" }] }
URI:/organistion/delegations
HTTP方法:POST
请求实体:
{ "userId": "", "orgId": "", "roleId": "", "delegateTo": [], "startTime": "", "endTime": "" }
响应实体:
{ }
URI:/organistion/delegations/:id
HTTP方法:DELETE
URI:/organistion/delegations?userId=:userId
HTTP方法:GET
响应实体:
{ "data": [{ "id": "", "orgName": "", "roleName": "", "delegaters": [{ "id": "", "name": "", "startTime": "", "endTime": "" }] }] }
URI:/runtime/process-instances/
HTTP方法:GET
请求参数:
starter keyword start=0 limit=20
响应实体:
{ "data": [{ "name": "", "creater": "", "sn": "", "taskId": "", "createTime": "" }] }
URI:/history/historic-process-instances/
HTTP方法:GET
请求参数:
starter keyword start=0 limit=20
响应实体:
{ "data": [{ "name": "", "creater": "", "sn": "", "taskId": "", "createTime": "" }] }
根据ID获取流程详情
待办、已办列表(分页),搜索
发起流程,保存,提交
流程评论、经过、否决、退回、删除、再次发起、催办、撤回、知会、@
代理设置,取消
选人组件,组织,人员,搜索
个人发起,审批中、已完成、草稿,搜索
高级搜索