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獲取流程詳情
待辦、已辦列表(分頁),搜索
發起流程,保存,提交
流程評論、經過、否決、退回、刪除、再次發起、催辦、撤回、知會、@
代理設置,取消
選人組件,組織,人員,搜索
個人發起,審批中、已完成、草稿,搜索
高級搜索