Introduction
Welcome to the Skylark API!
域名:
- 测试:https://beta.skylarkly.com
- 正式:https://skylarkly.com
注:
- 所有的开发对接工作在Beta https://beta.skylarkly.com 上完成,部署时会给线上环境的配置
Authentication
1、创建一个ApiApplication,获得appid
和appsecret
(由我们提供)
2、获得Namespace的id(由我们提供)
3、构建Authorization header
header
值的形式:appid
:encoded_data
appid
:为第一步获取到的appid
encoded_data
:以appsecret
为key,用JWT的HS256进行加密,加密payload为{"namespace_id":id}
(id为Integer)
示例:
appid: 56dc47367f8c775cf2318aa29345af558ad8aa2835bc3cc1d4416abfa94bd721
appsecret: 7bb73122837c4befb9c6593287f73a5e915415fe29f5aeb182717b66e873e96b
namespace_id: 1
JWT的
HEADER为:{"typ":"JWT","alg":"HS256"}
PAYLOAD为:{"namespace_id":1}
计算出encoded_data
为:
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJuYW1lc3BhY2VfaWQiOjF9.z-RcFpDiYBXAO8i88M_x1JpJRr6CDMo8sb1rU6dw-0E
最终构建出Authorization
header的值为:
56dc47367f8c775cf2318aa29345af558ad8aa2835bc3cc1d4416abfa94bd721:eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJuYW1lc3BhY2VfaWQiOjF9.z-RcFpDiYBXAO8i88M_x1JpJRr6CDMo8sb1rU6dw-0E
可以用jwt.io进行测试
实际使用中,处于安全的考虑,最好在payload中加入过期时间,如:
{"namespace_id":1,"exp":1535553256}
Pagination
- 参数
per_page
每页多少个,默认24
,范围1~100
page
页数
- 接口返回 Header (如果返回有以下Header,表示数据有分页)
- X-SLP-Current-Page: 当前页数
- X-SLP-Total-Pages: 总页数
- X-SLP-Total-Count: 总个数
- 例:
GET /api/v4/yaw/flows/:id/journeys?per_page=30&page=3
Wechat Client
注:
- access_token和jsapi_ticket都是在过期时间之前,可以一直使用,请求得到后而缓存之
- 不要用access_token去微信端请求jsapi_ticket,jsapi_ticket通过我们提供的接口获取
access_token
GET /api/v4/wechat_clients/access_token HTTP/1.1
HTTP/1.1 200 OK
{
"access_token": "15_2FkbrFbJuemSy3ANqLmHNu65bpflFlORFTO8tqnvw5a1C0EhF-nfGAvmRhjHqX9-bc8yWqk_2ezUfINwwGLvisa5kgrLQzOKP1rN6SxTixiDklu1fA3UK0GsO_a5nmrkfo_B44xcvtpEj78sVMKcAIAEVT",
"expired_at": "1541041188" // 过期的 unix 时间戳
}
GET /api/v4/wechat_clients/access_token
Parameters
- None
jsapi_ticket
GET /api/v4/wechat_clients/jsapi_ticket HTTP/1.1
HTTP/1.1 200 OK
{
"ticket": "sM4AOVdWfPE4DxkXGEs8VAT3lleStXwJQ-0K5TVdAa6VYKz9sECvxATXHT4fR5Vcqy8B4XnR3_fiV-xuSIWfjQ",
"expired_at": "1535715059" // 过期的 unix 时间戳
}
GET /api/v4/wechat_clients/jsapi_ticket
Parameters
- None
Pushes
微信推送
POST /api/v4/pushes/wechat HTTP/1.1
HTTP/1.1 200 OK
{
"title":"Happy Day",
"description":"Is Really A Happy Day",
"url":"URL",
"picurl":"PIC_URL"
}
news_entity 结构
结构固定,以下4个key都是必须的,具体意思参考微信微信客服消息
HTTP/1.1 200 OK
{
"template_id": "7L5ZG7D0VtqOnKp07bskkJ7XA7veVqIO2VYeY3aYLtY",
"url": "http://weixin.qq.com/download",
"data": {
"first": {
"value": "恭喜你购买成功!",
"color": "#173177"
},
"keyword1": {
"value": "巧克力",
"color": "#173177"
},
"keyword2": {
"value": "39.8元",
"color": "#173177"
},
"remark": {
"value": "欢迎再次购买!",
"color": "#173177"
}
}
}
template_entity 结构
结构固定,但data的实际结构会根据模板而改变,具体意思参考微信客服消息
Parameters
Name | Type | Description |
---|---|---|
openids | Array | Required 接收用户的openid的集合 |
news_entity | Object | 微信客服消息 |
template_entity | Object | 微信客服消息 |
news_entity
、template_entity
两者必须有一个。如果都存在,微信推送会先尝试客服消息,当客服消息失败时,再尝试模板消息
Response
Status: 200 OK
no body
Categories
获取当前空间下所有的分类
GET /api/v4/categories HTTP/1.1
Authorization: your_authorization
HTTP/1.1 200 OK
[
{
"id": 4,
"name": "庆山社区",
"depth": 1,
"description": "",
"icon": "fa-folder-open",
"position": 2,
"hidden": false,
"external_link": null,
"sort_type": "manual",
"cms_variables": "",
"ancestry": "1"
},
{
"id": 114,
"name": "办事指南",
"depth": 5,
"description": "",
"icon": "fa-folder-open",
"position": 1590572033,
"hidden": false,
"external_link": "http://wsq.cdyoue.com/namespaces/1/categories/111/pages/23",
"sort_type": "manual",
"cms_variables": "",
"ancestry": "1/38/39/80/111"
},
{
"id": 110,
"name": "热线咨询",
"depth": 5,
"description": "",
"icon": "fa-folder-open",
"position": 1590571945,
"hidden": false,
"external_link": "12321",
"sort_type": "manual",
"cms_variables": "",
"ancestry": "1/38/39/80/107"
}
]
GET /api/v4/categories
Parameters
Name | Type | Description | Comments |
---|
获取某一个分类
GET /api/v4/categories/:id HTTP/1.1
Authorization: your_authorization
HTTP/1.1 200 OK
{
"id": 4,
"name": "庆山社区",
"depth": 1,
"description": "",
"icon": "fa-folder-open",
"position": 2,
"hidden": false,
"external_link": null,
"sort_type": "manual",
"cms_variables": "",
"ancestry": "1"
}
GET /api/v4/categories
Parameters
Name | Type | Description | Comments |
---|---|---|---|
id | integer | 分类 id |
获取某一个分类下的分类
GET /api/v4/categories/:id/children HTTP/1.1
Authorization: your_authorization
HTTP/1.1 200 OK
{
[
{
"id": 258,
"name": "进行中",
"depth": 3,
"description": "",
"icon": "fa-folder-open",
"position": 1591236841,
"hidden": false,
"external_link": null,
"sort_type": "manual",
"cms_variables": "",
"ancestry": "1/2/7",
"created_at": "2020-06-04T10:14:01.858+08:00"
},
{
"id": 259,
"name": "已结束",
"depth": 3,
"description": "",
"icon": "fa-folder-open",
"position": 1591236849,
"hidden": false,
"external_link": null,
"sort_type": "manual",
"cms_variables": "",
"ancestry": "1/2/7",
"created_at": "2020-06-04T10:14:09.211+08:00"
}
]
}
GET /api/v4/categories/:id/children
Parameters
Name | Type | Description | Comments |
---|---|---|---|
id | integer | 分类 id |
获取某一个分类下的文章
GET /api/v4/categories/:id/pages HTTP/1.1
Authorization: your_authorization
HTTP/1.1 200 OK
[
{
"id": 38,
"title": "123456y",
"html_body": "<p>neirong</p>",
"description": "3456",
"position": 15974,
"external_link": null,
"cover": "http://fs.yqfw.cdyoue.com/FnFZ9AtEPQ-nZoNIxsi5QommGcBv",
"hidden": false,
"read_count": 2,
"created_at": "2020-06-03T17:02:54.296+08:00"
},
{
"id": 5,
"title": "高县“群众最满意医师”“最美乡村医生”评选活动,又来啦!",
"html_body": "<p> 活动详情 : </p><p>一、目的意义</p><p>加强行业文化建设,弘扬崇高职业精神,提振医疗卫生健康行业精气神,提升医疗卫生服务质量。以评选高县“群众最满意医师”“最美乡村医生”活动为载体,广泛宣传全县广大医务工作者恪尽职守、无私奉献、全心全意为患者服务的先进事迹,弘扬“大医精诚、救死扶伤”的卫生核心价值观,努力打造一支思想端正、业务过硬、作风扎实、爱岗敬业、无私奉献的医师队伍,为保障人民群众健康作出应有的贡献。</p><p>二、评选原则</p><p>坚持公平、公正、公开的原则,确保广泛的代表性和群众的公认度,面向临床第一线,面向工作业绩突出和医德医风高尚的优秀医务人员。</p><p>三、评选条件</p><p>(一)从事临床一线的在岗注册医师(含助师及聘用制医师),在岗注册乡村医生。在本院(本村卫生室)工作满五年,医师定期考核和年度考核合格以上等次。</p><p>(二)具有道德行为的先进性,自觉践行社会主义荣辱观,遵守公民基本道德规范,社会形象好、群众认可度高,是医师(乡村医生)队伍的先进典型代表。</p><p>(三)爱岗敬业,乐于奉献,坚持以病人为中心,主动、热情为病人提供优质、满意、安全的诊疗服务,深受同事、病人及家属的充分肯定和高度认可,具有感人的先进事迹,无任何不良医疗纠纷。</p><p>(四)刻苦钻研业务认真履行岗位职责,医学理论知识扎实,临床业务技能熟练,经验丰富,无四、五级病历,三基理论等相关考试无不及格现象,致力于发展医疗卫生健康事业,为医疗卫生健康事业发展作出突出贡献。</p><p>(五)被推荐人选的工作、学习、生活等方面的经历或行为,代表时代发展方向、社会价值观取向,具有示范性和导向性,体现中国传统美德和良好社会风尚。</p><p>(六)无违法违纪行为,无收受和索要红包、回扣记录。</p><p>(七)服务态度好,具有良好的医患沟通技巧和团队协作精神,无被病人或家属投诉的记录。</p><p>四、评选范围及奖项设置</p><p>评选范围:各医疗卫生单位(含民营医疗机构)在岗注册的医师(含助师及聘用制医师),在岗注册乡村医生。</p><p>奖项设置:“群众最满意医师”奖10名,提名奖5名;“最美乡村医生”5名,提名奖3名。</p><p>五、评选程序和步骤</p><p>(一)评选方法</p><p>采取综合评价法。按100分制计算,公众投票占总成绩的50%,综合评定占总成绩的50%。</p>",
"description": "",
"position": 150993,
"external_link": null,
"cover": "http://fs.yqfw.cdyoue.com/FnWzAvi2yclIi_cvyAV9PSbOe_Tx",
"hidden": false,
"read_count": 22,
"created_at": "2020-05-26T16:16:33.915+08:00"
}
]
GET /api/v4/categories/:id/pages
Parameters
Name | Type | Description | Comments |
---|---|---|---|
id | integer | 分类 id |
Comments
新增评论
Post /api/v4/comments HTTP/1.1
Authorization: your_authorization
{
"comment": {
"body": "2345678765434567"
},
"user_id": 690,
"cms_page_id": 341
}
HTTP/1.1 200 OK
{
"id": 265,
"author_id": 690,
"commentable_id": 341,
"commentable_type": "Cms::Page",
"body": "2345678765434567",
"status": "pending",
"handled_user_id": null,
"replied_comment_id": null,
"created_at": "2020-07-07T16:49:03.868+08:00",
"author": {
"id": 690,
"name": "郑薛林",
"nickname": "贤独丨🤺",
"phone": "15883535414",
"identifier": "15883535414",
"qq": null,
"headimgurl": "http://thirdwx.qlogo.cn/mmopen/vi_32/KU6FI52PPicLT6iaZ88S49btibcTic2OcnSg4gObibYyxc92giafHRwjpNgaPZKRiaRGt47sdoulxO3fqzdn69EjmyTwQ",
"openid": "oXDm5s0XDReFEqbMcAddC_CQGrNY",
"imported_alias": "郑薛林",
"from_wechat": false,
"tags": [],
"profile_submission": {
"entries": []
}
}
}
Post /api/v4/comments
Parameters
Name | Type | Description | Comments |
---|---|---|---|
body | string | 评论详情 | |
user_id | integer | 评论用户 ID | |
cms_page_id | integer | 文章 ID |
查询评论
Post /api/v4/comments HTTP/1.1
Authorization: your_authorization
HTTP/1.1 200 OK
[
{
"id": 261,
"author_id": 690,
"commentable_id": 341,
"commentable_type": "Cms::Page",
"body": "2345678765434567",
"status": "approved",
"handled_user_id": 690,
"replied_comment_id": null,
"created_at": "2020-07-07T16:45:41.098+08:00",
"author": {
"id": 690,
"name": "郑薛林",
"nickname": "贤独丨🤺",
"phone": "15883535414",
"identifier": "15883535414",
"qq": null,
"headimgurl": "http://thirdwx.qlogo.cn/mmopen/vi_32/KU6FI52PPicLT6iaZ88S49btibcTic2OcnSg4gObibYyxc92giafHRwjpNgaPZKRiaRGt47sdoulxO3fqzdn69EjmyTwQ",
"openid": "oXDm5s0XDReFEqbMcAddC_CQGrNY",
"imported_alias": "郑薛林",
"from_wechat": false,
"tags": [],
"profile_submission": {
"entries": []
}
}
}
]
Get /api/v4/comments
Parameters
Name | Type | Description | Comments |
---|
查询评论
Delete /api/v4/comments/:id HTTP/1.1
Authorization: your_authorization
HTTP/1.1 204 OK
Destroy /api/v4/comments/:id
Parameters
Name | Type | Description | Comments |
---|---|---|---|
id | integer | 评论 id |
Users
查询当前空间下所有用户
GET /api/v4/users HTTP/1.1
Authorization: your_authorization
HTTP/1.1 200 OK
[
{
"id": 1,
"name": "第一个管理员",
"nickname": "",
"phone": "1111111111",
"identifier": "1111111111",
"qq": "123",
"headimgurl": "/non-digested-assets/avatars/default.png",
"openid": "123",
"imported_alias": "第一个管理员",
"from_wechat": false,
"tags": [{
"id": 1,
"name": "b1",
"full_name": "bq-b1",
"color": "#e91e63",
"tag_group_id": 1,
"taggings_count": 9
}, {
"id": 3,
"name": "a1",
"full_name": "a1",
"color": "#ff5722",
"tag_group_id": 1,
"taggings_count": 4
}, {
"id": 8,
"name": "a2",
"full_name": "a2",
"color": "#673ab7",
"tag_group_id": 1,
"taggings_count": 1
}
},
{
"id": 1,
"name": "第二个管理员",
"nickname": "",
"phone": "12222222222",
"identifier": "12222222222",
"qq": "123",
"headimgurl": "/non-digested-assets/avatars/default.png",
"openid": "123",
"imported_alias": "第一个管理员",
"from_wechat": false,
"tags": [{
"id": 1,
"name": "b1",
"full_name": "bq-b1",
"color": "#e91e63",
"tag_group_id": 1,
"taggings_count": 9
}, {
"id": 3,
"name": "a1",
"full_name": "a1",
"color": "#ff5722",
"tag_group_id": 1,
"taggings_count": 4
}, {
"id": 8,
"name": "a2",
"full_name": "a2",
"color": "#673ab7",
"tag_group_id": 1,
"taggings_count": 1
}
}
]
GET /api/v4/users
所在组织
GET /api/v4/users/14473/organizations HTTP/1.1
Authorization: your_authorization
{
"name": "name",
"description": "description",
"application_strategy": "must_approved",
"founder_id": 3,
"patent_id": 13
}
HTTP/1.1 200 OK
[
{
"id": 14473,
"name": "child_1",
"description": "",
"description_text": "",
"created_at": "2017-04-18T16:33:07.408+08:00",
"updated_at": "2017-12-06T17:52:27.556+08:00",
"children_count": 1,
"parent_id": 14472,
"ancestry": "14472"
},
{
"id": 1935,
"name": "测试组织",
"description": "<p>aaa</p>",
"description_text": "aaa",
"created_at": "2015-05-25T15:58:45.083+08:00",
"updated_at": "2018-04-06T15:37:24.712+08:00",
"children_count": 2,
"parent_id": null,
"ancestry": null
},
...
]
GET /api/v4/users/:id/organizations
Parameters
Name | Type | Description | Comments |
---|---|---|---|
id | integer | 用户id |
查询用户信息
GET /api/v4/users/1 HTTP/1.1
Authorization: your_authorization
HTTP/1.1 200 OK
{
"id": 1,
"name": "第一个管理员",
"nickname": "",
"phone": "1111111111",
"identifier": "1111111111",
"qq": "123",
"headimgurl": "/non-digested-assets/avatars/default.png",
"openid": "123",
"imported_alias": "第一个管理员",
"from_wechat": false,
"tags": [{
"id": 1,
"name": "b1",
"full_name": "bq-b1",
"color": "#e91e63",
"tag_group_id": 1,
"taggings_count": 9
}, {
"id": 3,
"name": "a1",
"full_name": "a1",
"color": "#ff5722",
"tag_group_id": 1,
"taggings_count": 4
}, {
"id": 8,
"name": "a2",
"full_name": "a2",
"color": "#673ab7",
"tag_group_id": 1,
"taggings_count": 1
}
}
GET /api/v4/users/:id
Parameters
Name | Type | Description | Comments |
---|---|---|---|
id | integer | 用户id |
创建用户
POST /api/v4/users/ HTTP/1.1
Authorization: your_authorization
HTTP/1.1 200 OK
{
"id": 1,
"name": "第一个管理员",
"nickname": "",
"phone": "1111111111",
"identifier": "1111111111",
"qq": "123",
"headimgurl": "/non-digested-assets/avatars/default.png",
"openid": "123",
"imported_alias": "第一个管理员",
"from_wechat": false,
"tags": [{
"id": 1,
"name": "b1",
"full_name": "bq-b1",
"color": "#e91e63",
"tag_group_id": 1,
"taggings_count": 9
}, {
"id": 3,
"name": "a1",
"full_name": "a1",
"color": "#ff5722",
"tag_group_id": 1,
"taggings_count": 4
}, {
"id": 8,
"name": "a2",
"full_name": "a2",
"color": "#673ab7",
"tag_group_id": 1,
"taggings_count": 1
}
}
POST /api/v4/users
Parameters
Name | Type | Description | Comments |
---|---|---|---|
name | String | 名字 | |
identifier | String | 识别码 | |
phone | String | 手机号 | |
openid | String | 微信的 openid |
更新用户
PUT /api/v4/users/ HTTP/1.1
Authorization: your_authorization
HTTP/1.1 200 OK
{
"id": 1,
"name": "第一个管理员",
"nickname": "",
"phone": "1111111111",
"identifier": "1111111111",
"qq": "123",
"headimgurl": "/non-digested-assets/avatars/default.png",
"openid": "123",
"imported_alias": "第一个管理员",
"from_wechat": false,
"tags": [{
"id": 1,
"name": "b1",
"full_name": "bq-b1",
"color": "#e91e63",
"tag_group_id": 1,
"taggings_count": 9
}, {
"id": 3,
"name": "a1",
"full_name": "a1",
"color": "#ff5722",
"tag_group_id": 1,
"taggings_count": 4
}, {
"id": 8,
"name": "a2",
"full_name": "a2",
"color": "#673ab7",
"tag_group_id": 1,
"taggings_count": 1
}
}
PUT /api/v4/users
Parameters
Name | Type | Description | Comments |
---|---|---|---|
id | integer | 用户 id | |
name | String | 名字 | |
identifier | String | 识别码 | |
phone | String | 手机号 | |
openid | String | 微信的 openid |
更新用户标签
POST /api/v4/users/:id/tags
Authorization: your_authorization
HTTP/1.1 200 OK
{
"id": 1,
"name": "第一个管理员",
"nickname": "",
"phone": "1111111111",
"identifier": "1111111111",
"qq": "123",
"headimgurl": "/non-digested-assets/avatars/default.png",
"openid": "123",
"imported_alias": "第一个管理员",
"from_wechat": false,
"tags": [{
"id": 1,
"name": "b1",
"full_name": "bq-b1",
"color": "#e91e63",
"tag_group_id": 1,
"taggings_count": 9
}, {
"id": 3,
"name": "a1",
"full_name": "a1",
"color": "#ff5722",
"tag_group_id": 1,
"taggings_count": 4
}, {
"id": 8,
"name": "a2",
"full_name": "a2",
"color": "#673ab7",
"tag_group_id": 1,
"taggings_count": 1
}
}
POST /api/v4/users/:id/tags
Parameters
Name | Type | Description | Comments |
---|---|---|---|
id | integer | 用户 id | |
add_tag_ids | integer[] | 需要添加标签的 ids | |
remove_tag_ids | integer[] | 需要删除的标签 ids |
更新用户标签
GET /api/v4/users/:id/identity_certification
Authorization: your_authorization
HTTP/1.1 200 OK
{
"id": 1,
"data": {}
}
GET /api/v4/users/:id/identity_certification
Parameters
Name | Type | Description | Comments |
---|---|---|---|
id | integer | 用户 id |
更新用户标签
GET /api/v4/users/query
Authorization: your_authorization
HTTP/1.1 200 OK
[
{
"id": 1,
"name": "第一个管理员",
"nickname": "",
"phone": "1111111111",
"identifier": "1111111111",
"qq": "123",
"headimgurl": "/non-digested-assets/avatars/default.png",
"openid": "123",
"imported_alias": "第一个管理员",
"from_wechat": false,
"tags": [{
"id": 1,
"name": "b1",
"full_name": "bq-b1",
"color": "#e91e63",
"tag_group_id": 1,
"taggings_count": 9
}, {
"id": 3,
"name": "a1",
"full_name": "a1",
"color": "#ff5722",
"tag_group_id": 1,
"taggings_count": 4
}, {
"id": 8,
"name": "a2",
"full_name": "a2",
"color": "#673ab7",
"tag_group_id": 1,
"taggings_count": 1
}
}
]
GET /api/v4/users/query
Parameters
Name | Type | Description | Comments |
---|---|---|---|
keyword | string | 名字或手机号 |
Organizations
所有组织
GET /api/v4/organizations HTTP/1.1
Authorization: your_authorization
HTTP/1.1 200 OK
X-SLP-Current-Page: 1
X-SLP-Total-Pages: 1
X-SLP-Total-Count: 4
[
{
"id": 1,
"name": "开发部",
"description": "<p>您可以根据需要更改名字及描述,或者删除组织</p>",
"description_text": "您可以根据需要更改名字及描述,或者删除组织",
"created_at": "2016-08-26T18:08:22.624+08:00",
"updated_at": "2019-07-25T11:00:59.249+08:00",
"children_count": 4,
"parent_id": null,
"ancestry": null,
"application_strategy": "closed",
"profile_submission": {
"entries": [
{
"id": 513216,
"field_id": 4394,
"option_id": null,
"value": "2019-07-25",
"choice_id": null,
"value_id": null,
"latitude": null,
"longitude": null,
"group_id": null,
"detail_id": null
},
{
"id": 513215,
"field_id": 4393,
"option_id": 2948,
"value": "B",
"choice_id": null,
"value_id": null,
"latitude": null,
"longitude": null,
"group_id": null,
"detail_id": null
},
{
"id": 513214,
"field_id": 4393,
"option_id": 2947,
"value": "A",
"choice_id": null,
"value_id": null,
"latitude": null,
"longitude": null,
"group_id": null,
"detail_id": null
},
{
"id": 513213,
"field_id": 4380,
"option_id": 2933,
"value": "A",
"choice_id": null,
"value_id": null,
"latitude": null,
"longitude": null,
"group_id": null,
"detail_id": null
},
{
"id": 513212,
"field_id": 4379,
"option_id": null,
"value": "123",
"choice_id": null,
"value_id": null,
"latitude": null,
"longitude": null,
"group_id": null,
"detail_id": null
}
],
"cached_values": {
"4379": {
"value": [
"123"
],
"text_value": [
"123"
],
"exported_value": [
"123"
]
},
"4380": {
"value": [
{
"id": 2933,
"gid": "gid://skylark/Option/2933",
"value": "A"
}
],
"text_value": [
"A"
],
"exported_value": [
"A"
]
},
"4393": {
"value": [
{
"id": 2947,
"gid": "gid://skylark/Option/2947",
"value": "A"
},
{
"id": 2948,
"gid": "gid://skylark/Option/2948",
"value": "B"
}
],
"text_value": [
"A",
"B"
],
"exported_value": [
"A,B"
]
},
"4394": {
"value": [
"2019-07-25"
],
"text_value": [
"2019-07-25"
],
"exported_value": [
"2019-07-25"
]
}
}
}
},
{
"id": 15113,
"name": "组织_a",
"description": "",
"description_text": "",
"created_at": "2018-08-14T10:00:29.691+08:00",
"updated_at": "2018-08-14T10:00:40.625+08:00",
"children_count": 1,
"parent_id": 14516,
"ancestry": "14516"
},
{
"id": 15114,
"name": "组织_a_a",
"description": "",
"description_text": "",
"created_at": "2018-08-14T10:00:40.624+08:00",
"updated_at": "2018-08-14T10:00:40.624+08:00",
"children_count": 0,
"parent_id": 15113,
"ancestry": "14516/15113"
},
{
"id": 15115,
"name": "组织_b",
"description": "",
"description_text": "",
"created_at": "2018-08-14T10:00:49.660+08:00",
"updated_at": "2018-08-14T10:00:49.660+08:00",
"children_count": 0,
"parent_id": 14516,
"ancestry": "14516"
}
]
GET /api/v4/organizations
Parameters
- None
顶级组织
GET /api/v4/organizations/roots HTTP/1.1
Authorization: your_authorization
HTTP/1.1 200 OK
X-SLP-Current-Page: 1
X-SLP-Total-Pages: 1
X-SLP-Total-Count: 1
[
{
"id": 14516,
"name": "第一个组织",
"description": "您可以根据需要更改名字及描述,或者删除组织",
"description_text": "您可以根据需要更改名字及描述,或者删除组织",
"created_at": "2017-12-25T16:06:13.111+08:00",
"updated_at": "2018-08-14T10:00:49.663+08:00",
"children_count": 2,
"parent_id": null,
"ancestry": null
}
]
GET /api/v4/organizations/roots
Parameters
- None
子代组织
GET /api/v4/organizations/15113/children HTTP/1.1
Authorization: your_authorization
HTTP/1.1 200 OK
X-SLP-Current-Page: 1
X-SLP-Total-Pages: 1
X-SLP-Total-Count: 2
[
{
"id": 15113,
"name": "组织_a",
"description": "",
"description_text": "",
"created_at": "2018-08-14T10:00:29.691+08:00",
"updated_at": "2018-08-14T10:00:40.625+08:00",
"children_count": 1,
"parent_id": 14516,
"ancestry": "14516"
},
{
"id": 15115,
"name": "组织_b",
"description": "",
"description_text": "",
"created_at": "2018-08-14T10:00:49.660+08:00",
"updated_at": "2018-08-14T10:00:49.660+08:00",
"children_count": 0,
"parent_id": 14516,
"ancestry": "14516"
}
]
GET /api/v4/organizations/:id/children
Parameters
Name | Type | Description | Comments |
---|---|---|---|
id | integer | 父级组织id |
组织成员
GET /api/v4/organizations/:organization_id/members HTTP/1.1
Authorization: your_authorization
HTTP/1.1 200 OK
X-SLP-Current-Page: 1
X-SLP-Total-Pages: 1
X-SLP-Total-Count: 3
[
{
"id": 127059,
"name": "user_a",
"nickname": null,
"sex": null,
"phone": null,
"identifier": "user_a",
"openid": null,
"created_at": "2018-08-14T10:10:19.434+08:00",
"updated_at": "2018-08-14T10:10:19.434+08:00",
"headimgurl": "/non-digested-assets/avatars/default_96.png"
},
{
"id": 127060,
"name": "user_b",
"nickname": null,
"sex": null,
"phone": null,
"identifier": "user_b",
"openid": null,
"created_at": "2018-08-14T10:10:24.671+08:00",
"updated_at": "2018-08-14T10:10:24.671+08:00",
"headimgurl": "/non-digested-assets/avatars/default_96.png"
},
{
"id": 127061,
"name": "user_c",
"nickname": null,
"sex": null,
"phone": null,
"identifier": "user_c",
"openid": null,
"created_at": "2018-08-14T10:10:29.831+08:00",
"updated_at": "2018-08-14T10:10:29.831+08:00",
"headimgurl": "/non-digested-assets/avatars/default_96.png"
}
]
GET /api/v4/organizations/:id/members
Parameters
Name | Type | Description | Comments |
---|---|---|---|
organization_id | integer | 组织id | |
with_descendants | string | Optional 传任意值,代表包含子孙后代组织的成员 |
创建组织
POST /api/v4/organizations/ HTTP/1.1
Authorization: your_authorization
Content-Type: application/json
{
"name": "name",
"description": "description",
"application_strategy": "must_approved",
"founder_id": 3,
"patent_id": 13
}
HTTP/1.1 201 Created
Content-Type: application/json
{
"id": 25,
"name": "name",
"description": "description",
"description_text": "description",
"created_at": "2018-12-06T10:35:35.203+08:00",
"updated_at": "2018-12-06T10:35:35.203+08:00",
"children_count": 0,
"parent_id": "13",
"ancestry": "abc",
"application_strategy": "must_approved"
}
POST /api/v4/organizations/
Parameters
Name | Type | Description | Comments |
---|---|---|---|
name | string | 名字 | |
description | string | 描述 | |
application_strategy | string | 审核状态 | [:must_approved, :auto_approved, :closed] |
founder_id | integer | 创建者id | |
patent_id | integer | 父级组织id | 创建顶级组织时不需要 |
创建组织成员
POST /api/v4/organizations/20/members HTTP/1.1
Authorization: your_authorization
Content-Type: application/json
{
"name": "jack",
"identifier": "jack_123",
"phone": "10086100101"
}
HTTP/1.1 201 Created
Content-Type: application/json
{
"id": 20,
"name": "jack",
"nickname": null,
"sex": null,
"phone": "10086100101",
"identifier": "jack_123",
"openid": null,
"created_at": "2018-12-06T10:54:34.901+08:00",
"updated_at": "2018-12-06T10:54:34.901+08:00"
}
POST /api/v4/organizations/:organization_id/members
Parameters
Name | Type | Description | Comments |
---|---|---|---|
name | string | 名字 | |
identifier | string | 识别码 | |
phone | string | 电话号码 | |
organization_id | integer | 组织id |
修改组织信息
PUT /api/v4/organizations/21 HTTP/1.1
Authorization: your_authorization
Content-Type: application/json
{
"name": "修改组织名字",
"description": "修改组织描述",
"application_strategy": "must_approved"
}
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": 21,
"name": "修改组织名字",
"description": "修改组织描述",
"description_text": "修改组织描述",
"created_at": "2018-12-05T10:19:41.202+08:00",
"updated_at": "2018-12-13T09:29:52.080+08:00",
"children_count": 1,
"parent_id": null,
"ancestry": null,
"application_strategy": "must_approved"
}
PUS /api/v4/organizations/:id
Parameters
Name | Type | Description | Comments |
---|---|---|---|
id | integer | 组织id | |
name | string | 名字 | |
description | string | 描述 | |
application_strategy | string | 审核状态 | [:must_approved, :auto_approved, :closed] |
删除组织
DELETE /api/v4/organizations/21 HTTP/1.1
Authorization: your_authorization
Content-Type: application/json
HTTP/1.1 204 No Content
DELETE /api/v4/organizations/:id
Parameters
Name | Type | Description | Comments |
---|---|---|---|
id | integer | 组织id |
修改组织成员信息
PUT /api/v4/organizations/23/members/20 HTTP/1.1
Authorization: your_authorization
Content-Type: application/json
{
"name": "jack",
"identifier": "jack_123",
"phone": "10086100101"
}
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": 20,
"name": "jack",
"nickname": "jack",
"sex": null,
"phone": "10086100101",
"identifier": "jack_123",
"openid": null,
"created_at": "2018-12-06T10:54:34.901+08:00",
"updated_at": "2018-12-13T10:08:35.305+08:00"
}
PUT /api/v4/organizations/:organization_id/members/:id
Parameters
Name | Type | Description | Comments |
---|---|---|---|
id | integer | 组织id | |
organization_id | integer | 组织id | |
name | string | 名字 | |
identifier | string | 识别码 | |
phone | string | 电话号码 |
增加组织人员
PUT /api/v4/organizations/23/members/add HTTP/1.1
Authorization: your_authorization
Content-Type: application/json
{
"member_ids": [19]
}
HTTP/1.1 200 OK
Content-Type: application/json
[19]
PUT /api/v4/organizations/:organization_id/members/add
Parameters
Name | Type | Description | Comments |
---|---|---|---|
organization_id | integer | 组织id | |
member_ids | array | 成员id |
移除组织成员
PUT /api/v4/organizations/23/members/remove HTTP/1.1
Authorization: your_authorization
Content-Type: application/json
{
"member_ids": [19]
}
HTTP/1.1 200 OK
Content-Type: application/json
[19]
PUT /api/v4/organizations/:organization_id/members/remove
Parameters
Name | Type | Description | Comments |
---|---|---|---|
organization_id | integer | 组织id | |
member_ids | array | 成员id |
增加组织管理员
POST /api/v4/organizations/23/administrators HTTP/1.1
Authorization: your_authorization
Content-Type: application/json
{
"user_id": 19
"access_id": 1
}
HTTP/1.1 201 Created
Content-Type: application/json
{
"id": 33,
"user": {
"id": 19,
"name": "123",
"nickname": null,
"phone": "19929029450",
"identifier": "qwecasca",
"qq": null,
"headimgurl": "/non-digested-assets/avatars/default.png",
"openid": null,
"imported_alias": "123",
"from_wechat": false,
"tags": [],
"custom_values": []
},
"access": {
"id": 1,
"name": "超级管理员",
"actions": [
1,
3,
4
],
"founded": false
},
"organization": {
"id": 23,
"name": "123123",
"description": "123123",
"created_at": "2018-12-05T10:41:33.068+08:00"
}
}
POST /api/v4/organizations/:organization_id/administrators
Parameters
Name | Type | Description | Comments |
---|---|---|---|
user_id | integer | 成员id | |
access_id | integer | 权限id |
删除组织管理员
DELETE /api/v4/organizations/23/administrators/33 HTTP/1.1
Authorization: your_authorization
HTTP/1.1 204 No Content
DELETE /api/v4/organizations/:organization_id/administrators/:id
Name | Type | Description | Comments |
---|---|---|---|
organization_id | integer | 组织id | |
id | integer | 关联管理员id |
修改组织管理员权限
PUT /api/v4/organizations/23/administrators/33 HTTP/1.1
Authorization: your_authorization
Content-Type: application/json
{
"user_id": 19
"access_id": 1
}
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": 33,
"user": {
"id": 19,
"name": "123",
"nickname": null,
"phone": "19929029450",
"identifier": "qwecasca",
"qq": null,
"headimgurl": "/non-digested-assets/avatars/default.png",
"openid": null,
"imported_alias": "123",
"from_wechat": false,
"tags": [],
"custom_values": []
},
"access": {
"id": 1,
"name": "超级管理员",
"actions": [
1,
3,
4
],
"founded": false
},
"organization": {
"id": 23,
"name": "123123",
"description": "123123",
"created_at": "2018-12-05T10:41:33.068+08:00"
}
}
PUT /api/v4/organizations/:organization_id/administrators/:id
Parameters
Name | Type | Description | Comments |
---|---|---|---|
user_id | integer | 成员id | |
access_id | integer | 权限id | |
organization_id | integer | 组织id | |
id | integer | 关联管理员id |
查询当前组织管理员
GET /api/v4/organizations/:organization_id/administrators HTTP/1.1
Authorization: your_authorization
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"id": 18,
"user": {
"id": 3,
"name": "a11",
"nickname": null,
"phone": "18828072450",
"identifier": "18828072450",
"qq": null,
"headimgurl": "/non-digested-assets/avatars/default.png",
"openid": null,
"imported_alias": "a11",
"from_wechat": false,
"tags": [],
"custom_values": []
},
"access": {
"id": 2,
"name": "创建者",
"actions": [
1,
3,
4
],
"founded": true
},
"organization": {
"id": 23,
"name": "123123",
"description": "123123",
"created_at": "2018-12-05T10:41:33.068+08:00"
}
}
]
GET /api/v4/organizations/:organization_id/administrators
Parameters
Name | Type | Description | Comments |
---|---|---|---|
organization_id | integer | 组织id |
Forms
表单信息
GET /api/v4/forms/3987 HTTP/1.1
Authorization: your_authorization
HTTP/1.1 200 OK
{
"id":3987,
"title":"这是一个表单",
"description":"<p>哈哈</p>",
"created_at":"2018-02-08T15:32:02.921+08:00",
"updated_at":"2018-05-21T22:07:51.748+08:00",
"status":"published",
"fields":[
{
"id":38664,
"title":"文本",
"description":"",
"type":"Field::TextField",
"position":0,
"validations":[
"presence"
],
"other_option":null,
"visibility":"public_visibility",
"marked":false,
"settings":{
"layout":"block",
"other_option_settings":{
"limit":{
}
},
"length_limit":{
}
},
"detail_id":null
},
{
"id":38665,
"title":"段落",
"description":"",
"type":"Field::TextArea",
"position":1,
"validations":[
"presence"
],
"other_option":null,
"visibility":"public_visibility",
"marked":false,
"settings":{
"layout":"block",
"other_option_settings":{
"limit":{
}
},
"length_limit":{
}
},
"detail_id":null
},
{
"id":38663,
"title":"未命名标题",
"description":"",
"type":"Field::TextField",
"position":2,
"validations":[
],
"other_option":null,
"visibility":"public_visibility",
"marked":false,
"settings":{
"layout":"block",
"other_option_settings":{
"limit":{
}
},
"length_limit":{
}
},
"detail_id":null
},
{
"id":38666,
"title":"章节",
"description":"<p>章节细节</p>",
"type":"Field::SectionBreak",
"position":3,
"validations":[
],
"other_option":null,
"visibility":"public_visibility",
"marked":false,
"settings":{
"layout":"block",
"other_option_settings":{
"limit":{
}
},
"length_limit":{
}
},
"detail_id":null
},
{
"id":38667,
"title":"整数",
"description":"",
"type":"Field::Integer",
"position":4,
"validations":[
],
"other_option":null,
"visibility":"public_visibility",
"marked":false,
"settings":{
"layout":"block",
"other_option_settings":{
"limit":{
}
},
"length_limit":{
}
},
"detail_id":null
},
{
"id":38668,
"title":"日期时间",
"description":"",
"type":"Field::DateTime",
"position":5,
"validations":[
],
"other_option":null,
"visibility":"public_visibility",
"marked":false,
"settings":{
"layout":"block",
"input_type":"datetime-local",
"other_option_settings":{
"limit":{
}
},
"length_limit":{
}
},
"detail_id":null
},
{
"id":38669,
"title":"单选",
"description":"",
"type":"Field::RadioButton",
"position":6,
"validations":[
],
"other_option":"其他",
"visibility":"public_visibility",
"marked":false,
"settings":{
"layout":"list",
"other_option_settings":{
"limit":{
}
},
"length_limit":{
}
},
"detail_id":null,
"options":[
{
"id":31826,
"value":"4",
"settings":{
"limit_settings":{
}
},
"position":0
}
]
},
{
"id":38670,
"title":"多选",
"description":"",
"type":"Field::CheckBox",
"position":7,
"validations":[
"presence"
],
"other_option":"其他",
"visibility":"public_visibility",
"marked":false,
"settings":{
"layout":"list",
"other_option_settings":{
"limit":{
}
},
"length_limit":{
}
},
"detail_id":null,
"options":[
{
"id":31827,
"value":"4",
"settings":{
"limit_settings":{
}
},
"position":1518075122
}
]
},
{
"id":38671,
"title":"文件上传",
"description":"",
"type":"Field::File",
"position":8,
"validations":[
],
"other_option":null,
"visibility":"public_visibility",
"marked":false,
"settings":{
"layout":"block",
"other_option_settings":{
"limit":{
}
},
"length_limit":{
}
},
"detail_id":null
},
{
"id":38672,
"title":"级联选择",
"description":"",
"type":"Field::CascadedSelect",
"position":9,
"validations":[
"presence"
],
"other_option":null,
"visibility":"public_visibility",
"marked":false,
"settings":{
"layout":"block",
"other_option_settings":{
"limit":{
}
},
"length_limit":{
}
},
"detail_id":null
},
{
"id":38673,
"title":"组织",
"description":"",
"type":"Field::Organization",
"position":10,
"validations":[
"presence"
],
"other_option":null,
"visibility":"public_visibility",
"marked":false,
"settings":{
"layout":"block",
"other_option_settings":{
"limit":{
}
},
"length_limit":{
}
},
"detail_id":null
},
{
"id":38674,
"title":"评分",
"description":"",
"type":"Field::Rating",
"position":11,
"validations":[
"presence"
],
"other_option":null,
"visibility":"public_visibility",
"marked":false,
"settings":{
"layout":"block",
"other_option_settings":{
"limit":{
}
},
"length_limit":{
}
},
"detail_id":null
},
{
"id":38675,
"title":"地理位置",
"description":"",
"type":"Field::Location",
"position":12,
"validations":[
],
"other_option":null,
"visibility":"public_visibility",
"marked":false,
"settings":{
"layout":"block",
"other_option_settings":{
"limit":{
}
},
"length_limit":{
}
},
"detail_id":null
},
{
"id":38676,
"title":"明细",
"description":"呵呵",
"type":"Field::Detail",
"position":13,
"validations":[
],
"other_option":null,
"visibility":"public_visibility",
"marked":false,
"settings":{
"layout":"block",
"button_name":"添加菜单",
"other_option_settings":{
"limit":{
}
},
"length_limit":{
}
},
"detail_id":null,
"children":[
{
"id":38677,
"title":"文本",
"description":"",
"type":"Field::TextField",
"position":0,
"validations":[
"presence"
],
"other_option":null,
"visibility":"public_visibility",
"marked":false,
"settings":{
"layout":"block",
"other_option_settings":{
"limit":{
}
},
"length_limit":{
}
},
"detail_id":38676
},
{
"id":38678,
"title":"评分",
"description":"",
"type":"Field::Rating",
"position":1,
"validations":[
],
"other_option":null,
"visibility":"public_visibility",
"marked":false,
"settings":{
"layout":"block",
"other_option_settings":{
"limit":{
}
},
"length_limit":{
}
},
"detail_id":38676
}
]
}
]
}
GET /api/v4/forms/:id
Parameters
Name | Type | Description | Comments |
---|---|---|---|
id | integer | 表单id |
表单数据
GET /api/v4/forms/548795/responses HTTP/1.1
Authorization: your_authorization
HTTP/1.1 200 OK
X-SLP-Current-Page: 1
X-SLP-Total-Pages: 3
X-SLP-Total-Count: 100
[
{
"id": 174,
"created_at": "2019-02-25T22:00:00.364+08:00",
"cached_values": {
"61": {
"value": [
"dasdassaddsa"
],
"text_value": [
"dasdassaddsa"
],
"exported_value": [
"dasdassaddsa"
]
}
},
"user": {
"id": 1,
"name": "第一个管理员",
"nickname": "",
"sex": null,
"phone": null,
"identifier": "759251fe10d79e6c823b",
"openid": null,
"created_at": "2018-11-02T15:00:17.714+08:00",
"updated_at": "2018-11-07T10:22:43.440+08:00",
"headimgurl": "/non-digested-assets/avatars/default_96.png",
"tags": [
{
"id": 1,
"name": "b1"
}
]
},
"entries": [
{
"id": 117,
"field_id": 61,
"option_id": null,
"value": "dasdassaddsa",
"choice_id": null,
"value_id": null,
"latitude": null,
"longitude": null,
"group_id": null,
"detail_id": null
}
]
},
{
"id": 173,
"created_at": "2019-02-25T21:59:54.509+08:00",
"cached_values": {
"61": {
"value": [
"231213321"
],
"text_value": [
"231213321"
],
"exported_value": [
"231213321"
]
}
},
"user": {
"id": 1,
"name": "第一个管理员",
"nickname": "",
"sex": null,
"phone": null,
"identifier": "759251fe10d79e6c823b",
"openid": null,
"created_at": "2018-11-02T15:00:17.714+08:00",
"updated_at": "2018-11-07T10:22:43.440+08:00",
"headimgurl": "/non-digested-assets/avatars/default_96.png",
"tags": [
{
"id": 1,
"name": "b1"
}
]
},
"entries": [
{
"id": 116,
"field_id": 61,
"option_id": null,
"value": "231213321",
"choice_id": null,
"value_id": null,
"latitude": null,
"longitude": null,
"group_id": null,
"detail_id": null
}
]
}
]
GET /api/v4/forms/:id/responses
Parameters
Name | Type | Description | Comments |
---|---|---|---|
id | integer | 表单id |
查询单条数据
GET /api/v4/responses/:id HTTP/1.1
Authorization: your_authorization
HTTP/1.1 200 OK
{
"id": 1385,
"created_at": "2020-08-04T11:23:00.571+08:00",
"cached_values": {
"2": {
"value": [
"15884559372"
],
"text_value": [
"15884559372"
],
"exported_value": [
"15884559372"
]
},
"4": {
"value": [
"杨女士"
],
"text_value": [
"杨女士"
],
"exported_value": [
"杨女士"
]
}
},
"mapped_values": {
"payment_method": {
"value": [
{
"id": 126,
"gid": "gid://skylark/Option/126",
"value": "按揭"
}
],
"text_value": [
"按揭"
],
"exported_value": [
"按揭"
]
},
"saler_phone": {
"value": [
"12334566543"
],
"text_value": [
"12334566543"
],
"exported_value": [
"12334566543"
]
},
"customer_gender": {
"value": [
{
"id": 4,
"gid": "gid://skylark/Option/4",
"value": "女"
}
],
"text_value": [
"女"
],
"exported_value": [
"女"
]
},
"customer_phone": {
"value": [
"12121212112"
],
"text_value": [
"12121212112"
],
"exported_value": [
"12121212112"
]
},
"customer_name": {
"value": [
"杨女士"
],
"text_value": [
"杨女士"
],
"exported_value": [
"杨女士"
]
},
"motivation": {
"value": [
{
"id": 13,
"gid": "gid://skylark/Option/13",
"value": "家庭自住"
}
],
"text_value": [
"家庭自住"
],
"exported_value": [
"家庭自住"
]
},
"saler": {
"value": [
"张朦檬"
],
"text_value": [
"张朦檬"
],
"exported_value": [
"张朦檬"
]
},
"intention": {
"value": [
{
"id": 62,
"gid": "gid://skylark/Option/62",
"value": "D无意向"
}
],
"text_value": [
"D无意向"
],
"exported_value": [
"D无意向"
]
},
"living_area2": {
"value": [
{
"id": 547,
"gid": "gid://skylark/Option/547",
"value": "平乐"
}
],
"text_value": [
"平乐"
],
"exported_value": [
"平乐"
]
},
"entitlement": {
"value": [
{
"id": 128,
"gid": "gid://skylark/Option/128",
"value": "有"
}
],
"text_value": [
"有"
],
"exported_value": [
"有"
]
},
"remark": {
"value": [
"一个人到访,说的是给娃娃看房,娃娃在成都工作,然后在外面看了下环境就想走,进来给她讲户型也不是很感兴趣,然后就要慌到走。"
],
"text_value": [
"一个人到访,说的是给娃娃看房,娃娃在成都工作,然后在外面看了下环境就想走,进来给她讲户型也不是很感兴趣,然后就要慌到走。"
],
"exported_value": [
"一个人到访,说的是给娃娃看房,娃娃在成都工作,然后在外面看了下环境就想走,进来给她讲户型也不是很感兴趣,然后就要慌到走。"
]
},
"source": {
"value": [
{
"id": 484,
"gid": "gid://skylark/Option/484",
"value": "到访客户"
}
],
"text_value": [
"到访客户"
],
"exported_value": [
"到访客户"
]
},
"customer_resistance": {
"value": [
{
"id": 554,
"gid": "gid://skylark/Option/554",
"value": "区域"
},
{
"id": 555,
"gid": "gid://skylark/Option/555",
"value": "地段"
},
{
"id": 556,
"gid": "gid://skylark/Option/556",
"value": "户型"
},
{
"id": 557,
"gid": "gid://skylark/Option/557",
"value": "装修"
},
{
"id": 558,
"gid": "gid://skylark/Option/558",
"value": "价格"
}
],
"text_value": [
"区域",
"地段",
"户型",
"装修",
"价格"
],
"exported_value": [
"区域,地段,户型,装修,价格"
]
},
"preferred_apartment": {
"value": [
{
"id": 563,
"gid": "gid://skylark/Option/563",
"value": "住宅1F"
},
{
"id": 564,
"gid": "gid://skylark/Option/564",
"value": "住宅2F"
}
],
"text_value": [
"住宅1F",
"住宅2F"
],
"exported_value": [
"住宅1F,住宅2F"
]
},
"price_range": {
"value": [
{
"id": 543,
"gid": "gid://skylark/Option/543",
"value": "总价61-70万"
}
],
"text_value": [
"总价61-70万"
],
"exported_value": [
"总价61-70万"
]
},
"line_card": {
"value": [
{
"id": 762,
"gid": "gid://skylark/Option/762",
"value": "否"
}
],
"text_value": [
"否"
],
"exported_value": [
"否"
]
}
},
"involved_user_ids": [],
"involved_organization_ids": [],
"entries": [
{
"id": 10584,
"field_id": 423,
"option_id": 762,
"value": "否",
"choice_id": null,
"value_id": null,
"latitude": null,
"longitude": null,
"group_id": null,
"detail_id": null
},
{
"id": 10583,
"field_id": 163,
"option_id": 484,
"value": "到访客户",
"choice_id": null,
"value_id": null,
"latitude": null,
"longitude": null,
"group_id": null,
"detail_id": null
}
],
"user": {
"id": 75,
"name": "张朦檬",
"nickname": "Smile",
"sex": 2,
"phone": "15884559372",
"identifier": "15884559372",
"openid": "ouvMN1qTZ_ucaufm5HFI26w_Q43A",
"created_at": "2020-07-03T10:17:37.855+08:00",
"updated_at": "2020-07-03T11:13:04.931+08:00",
"headimgurl": "http://thirdwx.qlogo.cn/mmopen/vi_32/AAlQYG92O3xBbrZniaa6uv6ex5wTeUyllIKYu7zWwrqrCvoL9jCuic21P7sGR52r1WjgsCxMic5kSzwiahz5JClxbQ/96",
"tags": [
{
"id": 2,
"name": "magnate_saler"
},
{
"id": 1,
"name": "magnate_admin"
}
],
"organizations": [
{
"id": 8,
"name": "销售",
"description": "",
"created_at": "2020-07-03T10:17:02.093+08:00"
}
]
}
}
GET /api/v4/responses/:id
Parameters
Name | Type | Description | Comments |
---|---|---|---|
id | integer | 记录 id |
搜索表单记录
Flows
获取流程详情
GET /api/v4/yaw/flows/:id HTTP/1.1
Authorization: your_authorization
HTTP/1.1 200 OK
{
"id":8,
"title":"简单流程",
"fields":[
{
"id":38761,
"title":"别填",
"description":null
},
{
"id":38806,
"title":"明细清单",
"description":null
}
],
"vertices":[
{
"id":78,
"name":"开始节点",
"type":"YetAnotherWorkflow::Vertex::Initial"
},
{
"id":80,
"name":"流程节点3",
"type":"YetAnotherWorkflow::Vertex::Normal"
},
{
"id":79,
"name":"结束节点",
"type":"YetAnotherWorkflow::Vertex::Final"
},
{
"id":90,
"name":"流程节点2",
"type":"YetAnotherWorkflow::Vertex::Normal"
},
{
"id":91,
"name":"流程节点1",
"type":"YetAnotherWorkflow::Vertex::Normal"
},
{
"id":113,
"name":"开始节点",
"type":"YetAnotherWorkflow::Vertex::Initial"
},
{
"id":114,
"name":"结束节点",
"type":"YetAnotherWorkflow::Vertex::Final"
}
],
"edges":[
{
"id":101,
"from_vertex_id":78,
"to_vertex_id":91
},
{
"id":92,
"from_vertex_id":80,
"to_vertex_id":79
},
{
"id":103,
"from_vertex_id":90,
"to_vertex_id":80
},
{
"id":102,
"from_vertex_id":91,
"to_vertex_id":90
}
]
}
GET /api/v4/yaw/flows/:id
Parameters
Name | Type | Description | Comments |
---|---|---|---|
id | integer | 流程id |
获取发起的流程任务列表
GET /api/v4/yaw/flows/:id/journeys HTTP/1.1
Authorization: your_authorization
HTTP/1.1 200 OK
X-SLP-Current-Page: 1
X-SLP-Total-Pages: 29
X-SLP-Total-Count: 2
[
{
"id":110,
"sn":"820180503184630000029",
"status":"processing",
"current_duration_threshold":null,
"created_at":"2018-06-06T15:39:10.532+08:00",
"updated_at":"2018-06-06T15:39:10.532+08:00",
"current_vertex_id":91,
"reviewer_vertex_ids":[
78
],
"response":{
"id":548288,
"cached_values":{
"38761":{
"value":[
"123123123"
],
"text_value":[
"123123123"
],
"exported_value":[
"123123123"
]
}
}
},
"user":{
"id":17013,
"name":"aaaa",
"identifier":"12345",
"headimgurl":"/non-digested-assets/avatars/default.png"
}
},
...
]
GET /api/v4/yaw/flows/:id/journeys
Parameters
Name | Type | Description | Comments |
---|---|---|---|
id | integer | 流程id |
获取某条流程任务的所有 Moment
GET /api/v4/yaw/journeys/:id/moments HTTP/1.1
Authorization: your_authorization
HTTP/1.1 200 OK
[
{
"id": 392,
"status": "proposed",
"comment": null,
"esignature": "data:image/png;base64,something",
"created_at": "2018-06-29T15:09:31.835+08:00",
"updated_at": "2018-06-29T15:09:31.835+08:00",
"vertex_id": 168,
"user": {
"id": 127057,
"name": "cacao",
"identifier": null,
"headimgurl": "/non-digested-assets/avatars/default.png"
}
},
{
"id": 393,
"status": "approved",
"comment": "",
"esignature": "data:image/png;base64,something",
"created_at": "2018-06-29T15:09:46.297+08:00",
"updated_at": "2018-06-29T15:09:46.297+08:00",
"vertex_id": 170,
"user": {
"id": 127057,
"name": "cacao",
"identifier": null,
"headimgurl": "/non-digested-assets/avatars/default.png"
}
}
]
GET /api/v4/yaw/journeys/:id/moments
Parameters
Name | Type | Description | Comments |
---|---|---|---|
id | integer | 流程id |
创建流程任务(route)
POST /api/v4/yaw/flows/:id/journeys HTTP/1.1
Authorization: your_authorization
{
"assignment": {
"operation": "route",
"response_attributes": {
"entries_attributes": [
{
"field_id": 7199,
"value": "test"
},
{
"field_id": 7200,
"value": "新选项",
"option_id": 8854
},
{
"field_id": 7201,
"value": "2020-11-18"
},
{
"field_id": 7202,
"value": "WechatIMG132.jpeg",
"value_id": 3839,
"_destroy": false
}
]
}
}
}
HTTP/1.1 200 OK
{
"assignment": {
"id": 7802,
"status": "stashed",
"category": "proposed",
"read": true,
"current_duration_threshold": null,
"created_at": "2020-11-18T15:20:08.113+08:00",
"updated_at": "2020-11-18T15:45:24.343+08:00",
"after_submit_action": "default",
"after_submit_redirect_url": null,
"gid": "gid://skylark/YetAnotherWorkflow::Assignment/7802",
"pretty_current_duration_threshold": null,
"journey": {
"id": 2236,
"sn": "145920201118152008000001",
"custom_sn": null,
"status": "stashed",
"current_duration_threshold": null,
"created_at": "2020-11-18T15:20:08.076+08:00",
"updated_at": "2020-11-18T15:20:08.076+08:00",
"gid": "gid://skylark/YetAnotherWorkflow::Journey/2236",
"pretty_current_duration_threshold": null,
"response": {
"id": 78149,
"created_at": "2020-11-18T15:20:08.063+08:00",
"entries": []
},
"user": {
"id": 79,
"name": "樊翔宇",
"nickname": "k k",
"phone": "18828072450",
"identifier": "18828072450",
"qq": null,
"headimgurl": "https://thirdwx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTKFLWWPT1sSVywib8qpNNfLjMOliblYqa105ibCOKGvzwRV0vAEAlGLcwXia8AK9FQiavG1tDxcCCkfUCA",
"openid": "oXDm5s2v7fnJ2Mut-UiiHtCEIb6Q",
"imported_alias": "樊翔宇",
"gid": "gid://skylark/User/79"
}
},
"response": {
"id": 78150,
"created_at": "2020-11-18T15:20:08.097+08:00",
"entries": [
{
"id": 1141143,
"field_id": 7202,
"option_id": null,
"value": "WechatIMG132.jpeg",
"choice_id": null,
"value_id": 3839,
"latitude": null,
"longitude": null,
"group_id": null,
"detail_id": null,
"attachment": {
"id": 3839,
"name": "WechatIMG132.jpeg",
"size": "16998",
"mime_type": "image/jpeg",
"extension": "image",
"extra_info": {}
}
},
{
"id": 1141142,
"field_id": 7201,
"option_id": null,
"value": "2020-11-18",
"choice_id": null,
"value_id": null,
"latitude": null,
"longitude": null,
"group_id": null,
"detail_id": null
},
{
"id": 1141141,
"field_id": 7200,
"option_id": 8854,
"value": "新选项",
"choice_id": null,
"value_id": null,
"latitude": null,
"longitude": null,
"group_id": null,
"detail_id": null
},
{
"id": 1141140,
"field_id": 7199,
"option_id": null,
"value": "test",
"choice_id": null,
"value_id": null,
"latitude": null,
"longitude": null,
"group_id": null,
"detail_id": null
}
]
}
},
"next_vertices": [
{
"id": 5600,
"name": "流程节点",
"type": "YetAnotherWorkflow::Vertex::Normal",
"metadata": {
"position": {
"x": 397,
"y": 251.703125
}
},
"operations": {
"route": {
"name": "选路",
"enabled": true
},
"refuse": {
"name": "回退",
"enabled": true
},
"approve": {
"name": "通过",
"enabled": true
},
"comment": {
"name": "处理意见",
"enabled": true
},
"transfer": {
"name": "转交",
"enabled": true
},
"esignature": {
"name": "电子签字",
"enabled": false
}
},
"settings": {
"carbon_copy": {
"enable_manual": false
},
"refuse_mode": 1,
"assign_manually": false,
"batch_processing": false,
"duration_threshold": {
"value": null,
"enable_delay": false,
"business_time": {
"final": "17:00",
"initial": "09:00",
"workday": true
},
"enable_manual": false,
"enable_business_time": false
},
"distributed_equally": false
},
"graph_id": 1730,
"created_at": "2020-11-18T15:20:05.493+08:00",
"updated_at": "2020-11-18T15:20:05.568+08:00",
"gid": "gid://skylark/YetAnotherWorkflow::Vertex::Normal/5600",
"fields": []
}
],
"next_graphs": [
{
"id": 1730,
"name": "主流程",
"ancestry": null,
"settings": {
"visibility": "public",
"duration_threshold": {
"value": null,
"enable_delay": false,
"business_time": {
"final": "17:00",
"initial": "09:00",
"workday": true
},
"enable_manual": false,
"enable_business_time": false
}
},
"metadata": {},
"created_at": "2020-11-18T15:03:32.377+08:00",
"updated_at": "2020-11-18T15:03:32.487+08:00",
"gid": "gid://skylark/YetAnotherWorkflow::Graph/1730"
}
]
}
POST /api/v4/yaw/flows/:id/journeys
Parameters
Name | Type | Description | Comments |
---|---|---|---|
operation | string | 寻路固定为 route | |
其他参数参考表单提交填写记录 |
发起流程任务(发起)
POST /api/v4/yaw/flows/:id/journeys HTTP/1.1
Authorization: your_authorization
{
"assignment": {
"operation": "propose",
"next_vertex_id": 1
}
HTTP/1.1 200 OK
{
"id": 7802,
"status": "processing",
"category": "proposed",
"read": true,
"current_duration_threshold": null,
"created_at": "2020-11-18T16:05:08.207+08:00",
"updated_at": "2020-11-18T16:05:08.261+08:00",
"after_submit_action": "default",
"after_submit_redirect_url": null,
"gid": "gid://skylark/YetAnotherWorkflow::Assignment/7802",
"pretty_current_duration_threshold": null,
"journey": {
"id": 2236,
"sn": "145920201118152008000001",
"custom_sn": null,
"status": "processing",
"current_duration_threshold": null,
"created_at": "2020-11-18T16:05:08.207+08:00",
"updated_at": "2020-11-18T16:05:08.207+08:00",
"gid": "gid://skylark/YetAnotherWorkflow::Journey/2236",
"pretty_current_duration_threshold": null,
"response": {
"id": 78149,
"created_at": "2020-11-18T15:20:08.063+08:00",
"entries": []
},
"user": {
"id": 79,
"name": "樊翔宇",
"nickname": "k k",
"phone": "18828072450",
"identifier": "18828072450",
"qq": null,
"headimgurl": "https://thirdwx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTKFLWWPT1sSVywib8qpNNfLjMOliblYqa105ibCOKGvzwRV0vAEAlGLcwXia8AK9FQiavG1tDxcCCkfUCA",
"openid": "oXDm5s2v7fnJ2Mut-UiiHtCEIb6Q",
"imported_alias": "樊翔宇",
"gid": "gid://skylark/User/79"
}
},
"response": {
"id": 78150,
"created_at": "2020-11-18T15:20:08.097+08:00",
"entries": [
{
"id": 1141143,
"field_id": 7202,
"option_id": null,
"value": "WechatIMG132.jpeg",
"choice_id": null,
"value_id": 3839,
"latitude": null,
"longitude": null,
"group_id": null,
"detail_id": null,
"attachment": {
"id": 3839,
"name": "WechatIMG132.jpeg",
"size": "16998",
"mime_type": "image/jpeg",
"extension": "image",
"extra_info": {}
}
},
{
"id": 1141142,
"field_id": 7201,
"option_id": null,
"value": "2020-11-18",
"choice_id": null,
"value_id": null,
"latitude": null,
"longitude": null,
"group_id": null,
"detail_id": null
},
{
"id": 1141141,
"field_id": 7200,
"option_id": 8854,
"value": "新选项",
"choice_id": null,
"value_id": null,
"latitude": null,
"longitude": null,
"group_id": null,
"detail_id": null
},
{
"id": 1141140,
"field_id": 7199,
"option_id": null,
"value": "test",
"choice_id": null,
"value_id": null,
"latitude": null,
"longitude": null,
"group_id": null,
"detail_id": null
}
]
}
}
POST /api/v4/yaw/flows/:id/journeys
Parameters
Name | Type | Description | Comments |
---|---|---|---|
operation | string | 发起固定为 propose | |
next_vertex_id | integer | 需要到达的下一个流程节点,从 [发起流程任务(寻路)] 的返回结果获取 |
发起流程任务(发起)
GET /api/v4/yaw/flows/:id/journey_ids HTTP/1.1
Authorization: your_authorization
HTTP/1.1 200 OK
[
1,2,3
]
GET /api/v4/yaw/flows/:id/journeys
Parameters
Name | Type | Description | Comments |
---|---|---|---|
id | integer | 流程 id |
获取某个用户发起的流程
GET /api/v4/yaw/flows/:flow_id/journeys/proposed_journeys HTTP/1.1
Authorization: your_authorization
HTTP/1.1 200 OK
[
{
"id": 7802,
"status": "processing",
"category": "proposed",
"read": true,
"current_duration_threshold": null,
"created_at": "2020-11-18T16:05:08.207+08:00",
"updated_at": "2020-11-18T16:05:08.261+08:00",
"after_submit_action": "default",
"after_submit_redirect_url": null,
"gid": "gid://skylark/YetAnotherWorkflow::Assignment/7802",
"pretty_current_duration_threshold": null,
"journey": {
"id": 2236,
"sn": "145920201118152008000001",
"custom_sn": null,
"status": "processing",
"current_duration_threshold": null,
"created_at": "2020-11-18T16:05:08.207+08:00",
"updated_at": "2020-11-18T16:05:08.207+08:00",
"gid": "gid://skylark/YetAnotherWorkflow::Journey/2236",
"pretty_current_duration_threshold": null,
"response": {
"id": 78149,
"created_at": "2020-11-18T15:20:08.063+08:00",
"entries": []
},
"user": {
"id": 79,
"name": "樊翔宇",
"nickname": "k k",
"phone": "18828072450",
"identifier": "18828072450",
"qq": null,
"headimgurl": "https://thirdwx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTKFLWWPT1sSVywib8qpNNfLjMOliblYqa105ibCOKGvzwRV0vAEAlGLcwXia8AK9FQiavG1tDxcCCkfUCA",
"openid": "oXDm5s2v7fnJ2Mut-UiiHtCEIb6Q",
"imported_alias": "樊翔宇",
"gid": "gid://skylark/User/79"
}
},
"response": {
"id": 78150,
"created_at": "2020-11-18T15:20:08.097+08:00",
"entries": [
{
"id": 1141143,
"field_id": 7202,
"option_id": null,
"value": "WechatIMG132.jpeg",
"choice_id": null,
"value_id": 3839,
"latitude": null,
"longitude": null,
"group_id": null,
"detail_id": null,
"attachment": {
"id": 3839,
"name": "WechatIMG132.jpeg",
"size": "16998",
"mime_type": "image/jpeg",
"extension": "image",
"extra_info": {}
}
},
{
"id": 1141142,
"field_id": 7201,
"option_id": null,
"value": "2020-11-18",
"choice_id": null,
"value_id": null,
"latitude": null,
"longitude": null,
"group_id": null,
"detail_id": null
},
{
"id": 1141141,
"field_id": 7200,
"option_id": 8854,
"value": "新选项",
"choice_id": null,
"value_id": null,
"latitude": null,
"longitude": null,
"group_id": null,
"detail_id": null
},
{
"id": 1141140,
"field_id": 7199,
"option_id": null,
"value": "test",
"choice_id": null,
"value_id": null,
"latitude": null,
"longitude": null,
"group_id": null,
"detail_id": null
}
]
}
}
]
GET /api/v4/yaw/flows/:flow_id/journeys/proposed_journeys
Parameters
Name | Type | Description | Comments |
---|---|---|---|
flow_id | integer | 流程 id | |
user_id | integer | 用户 id |
Attachments
查询
GET /api/v4/attachments/query?ids[]=:id&ids[]=:id HTTP/1.1
Authorization: your_authorization
HTTP/1.1 200 OK
[
{
"id": 2474,
"name": "test.png",
"size": "81702",
"mime_type": "image/png",
"extension": "image",
"extra_info": {},
"download_url": "http://7xlxax.dl1.z0.glb.clouddn.com/17013-1531909931-49d1c668335fe2fc660e92042431d544-1531909931258?attname=%E5%B1%8F%E5%B9%95%E5%BF%AB%E7%85%A7+2018-07-16+%E4%B8%8B%E5%8D%883.40.46.png&e=1532329592&token=WFpC8JEsN77rEZRgdoQgQw-yB82e-j3fpp8dXB8Z:JZFJ7usX7rWZ6hxZgkdkq3WWhXw="
},
...
]
GET /api/v4/attachments/query
Parameters
Name | Type | Description | Comments |
---|---|---|---|
ids | array | 附件id的集合 | |
fops | string | 七牛云图片处理的参数,文档 |
获取附件上传的 Token
GET /api/v4/attachments/uptoken?purpose=create_responses HTTP/1.1
Authorization: your_authorization
HTTP/1.1 200 OK
{
"uptoken": "WFpC8JEsN77rEZRgdoQgQw-yB82e-j3fpp8dXB8Z:hQdV5hQ3etWr_MVcMwe8HpHf3bo=:eyJzY29wZSI6InNscC1hdHRhY2htZW50LWJldGEiLCJzYXZlS2V5IjoiMS9jcmVhdGVfcmVzcG9uc2VzLy0xNTk0MDA1ODk0LTFhMmU2ZGVkOGZkMDdiZTM2ZjEzNDI3Yjg4Yzk2MDExLSQoeDprZXkpIiwiY2FsbGJhY2tVcmwiOiJodHRwczovL2JldGEuc2t5bGFya2x5LmNvbS9hdHRhY2htZW50cy5qc29uIiwiY2FsbGJhY2tCb2R5Ijoia2V5PSQoa2V5KVx1MDAyNm5hbWU9JChmbmFtZSlcdTAwMjZzaXplPSQoZnNpemUpXHUwMDI2bWltZV90eXBlPSQobWltZVR5cGUpIiwiZGVhZGxpbmUiOjE1OTQwMDk0OTQsImZzaXplTGltaXQiOjUyNDI4ODAwLCJ1cGhvc3RzIjpbImh0dHA6Ly91cC5xaW5pdS5jb20iLCJodHRwOi8vdXBsb2FkLnFpbml1LmNvbSIsIi1IIHVwLnFpbml1LmNvbSBodHRwOi8vMTgzLjEzMS43LjMiXSwiZ2xvYmFsIjpmYWxzZX0="
}
GET /api/v4/attachments/uptoken
Name | Type | Description | Comments |
---|---|---|---|
purpose | string | 固定为 create_responses |
上传附件到七牛
POST https://up.qbox.me/ HTTP/1.1
Authorization: your_authorization
HTTP/1.1 200 OK
{
"extension": "image",
"extra_info": {},
"id": 3258,
"mime_type": "image/jpeg",
"name": "test.jpg",
"size": "41491"
}
POST https://up.qbox.me/
Name | Type | Description | Comments |
---|---|---|---|
token | string | [获取附件上传的 Token] | |
file | file | 文件 | |
x:key | integer | 暂时固定为 1593586993541 |
创建附件(作为七牛的 callback)
POST /api/v4/attachments HTTP/1.1
HTTP/1.1 200 OK
POST /api/v4/attachments
Name | Type | Description | Comments |
---|---|---|---|
key | string | 获取文件的 key | |
name | string | 文件名称 | |
size | integer | 文件大小 | |
mime_type | 文件类型 |
查询附件以 Base64 编码返回
GET /api/v4/attachments/:id/base64_file HTTP/1.1
Authorization: your_authorization
HTTP/1.1 200 OK
{
***
}
GET /api/v4/forms/:id
Accesses
获取当前空间下所有权限
GET /api/v4/accesses HTTP/1.1
Authorization: your_authorization
HTTP/1.1 200 OK
[
{
"id": 1,
"name": "超级管理员",
"actions": [
1,
3,
4
],
"founded": false
},
{
"id": 7,
"name": "测试管理员",
"actions": [
4
],
"founded": false
}
]
GET /api/v4/accesses
Settings
批量删除不在任何组织中的成员
DELETE /api/v4/settings/remove_suspended_members HTTP/1.1
Authorization: your_authorization
HTTP/1.1 204 No Content
DELETE /api/v4/settings/remove_suspended_members
Column Explanation
数据库表解释
Flow: 管理员创建的流程
- Field: 发起人所需要填写的字段
- Vertex & Edge: 节点和边,可以构建出流程的策略图
Journey: 用户发起的流程
- Assignment: 处理者收到的任务
- Response: 处理者填写的数据
- Moment: 一条流程所有的事件,发起、通过、拒绝、转交...
字段解释
Flow Column | Meaning |
---|---|
title | 流程名称 |
Field Column | Meaning |
---|---|
title | 字段名称 |
description | 字段描述 |
Vertex Column | Meaning |
---|---|
title | 节点名称 |
type | 节点描述 |
Edge Column | Meaning |
---|---|
from_vertex_id | 入节点id |
to_vertex_id | 出节点id |
Journey Column | Meaning |
---|---|
sn | 流程编号 |
status | 状态 |
current_vertex_id | 当前节点id |
reviewer_vertex_ids | 已完成的节点ids |
Journey Column | Meaning |
---|---|
vertex_id | 节点id |
status | 状态 |
categroy | proposed : 为发起人创建的; processed : 为每个处理人创建的; cc : 为抄送者创建的 |
operation_data | 处理的相关数据 |
operation_data[comment] | 处理意见 |
operation_data[esignature] | 电子签名,base64编码的图片 |
operation_data[next_vertex_id] | 下一节点id |
operation_data[next_reviewer_ids] | 指定下一节点处理人id |
operation_data[duration_thresholds] | 下一节点处理时间限制 |
operation_data[carbon_copy_user_ids] | 抄送给其他用户id |
Moment Column | Meaning |
---|---|
status | 意义参考journey status |
comment | 处理意见 |
esignature | 电子签名,base64编码的图片 |
vertex_id | 处理节点id |
user | 发起人或处理人 |
User Column | Meaning |
---|---|
name | 姓名 |
identifier | 识别码 |
headimgurl | 头像 |
Response Column | Meaning |
---|---|
cached_values | json 数据 |
流程状态解释
- 当流程发起时(Journey Create),会为发起人创建一个proposed Assignment
- 当流程到达处理人节点是,会为每一个处理人创建一个processed Assignment
- proposed Assignment和Journey的状态是同步变化的,eg: Journey为finished, proposed Assignment也为finished
- processed Assignment状态对Journey影响
- 当所有节点都通过(approved)时,流程(Journey)变成finished
- 处理人拒绝(refused)到开始节点,流程(Journey)变成receding
处理人(processed) Assignment Status | Meaning |
---|---|
processing | 任务正在处理中 |
approved | 通过 |
refused | 拒绝, 可能拒绝到开始节点;可能拒绝到上一节点 |
transferred | 转交 |
skipped | 被其他人处理 |
发起人(proposed) Assignment Status | Meaning |
---|---|
processing | 流程正在处理中 |
cancelled | 发起人撤销流程 |
receding | 被处理人回退到开始节点 |
finished | 所有节点通过,流程完成 |
aborted | 管理员手动终止流程 |
suspended | 流程异常,eg: 找不到下一节点;下一节点没有处理人... |
Response cached_values 说明
- 展示建议使用text_value
- 附件的下载地址有权限限制,如果想获取附件真正的下载地址,通过附件接口
一般字段
{
`field_id`: {
{
value: [...],
text_value: [...],
exported_value: [...]
}
}
}
明细`(Field::Detail)`字段
{
`detail_id`: {
group_ids: [...],
child_ids: [...]
}
}
明细内的字段
{
`child_id`: {
grouped_ids: [...],
grouped_values: [
`group_id`: {
group_id: `group_id`,
value: [...],
text_value: [...],
exported_value: [...]
}
]
}
}
Tags
查询空间下标签类型
GET /api/v4/tags HTTP/1.1
Authorization: your_authorization
{
"type": "user"
}
or
{
"type": "receipt"
}
HTTP/1.1 200 OK
[
{
"id": 1,
"name": "歌手",
"full_name": "歌手"
},
{
"id": 1,
"name": "演员",
"full_name": "演员"
}
]
GET /api/v4/tags
Parameters
Name | Type | Description | Comments |
---|---|---|---|
type | string | 标签类型 |
查询成员标签下的成员
GET /api/v4/tags/1/taggable_users HTTP/1.1
Authorization: your_authorization
HTTP/1.1 200 OK
[
{
"id": 1,
"name": "第一个管理员",
"nickname": "",
"phone": "1111111111",
"identifier": "1111111111",
"qq": "123",
"headimgurl": "/non-digested-assets/avatars/default.png",
"openid": "123",
"imported_alias": "第一个管理员",
"from_wechat": false,
"tags": [{
"id": 1,
"name": "b1",
"full_name": "bq-b1",
"color": "#e91e63",
"tag_group_id": 1,
"taggings_count": 9
}, {
"id": 3,
"name": "a1",
"full_name": "a1",
"color": "#ff5722",
"tag_group_id": 1,
"taggings_count": 4
}, {
"id": 8,
"name": "a2",
"full_name": "a2",
"color": "#673ab7",
"tag_group_id": 1,
"taggings_count": 1
}
},
{
"id": 1,
"name": "第二个管理员",
"nickname": "",
"phone": "12222222222",
"identifier": "12222222222",
"qq": "123",
"headimgurl": "/non-digested-assets/avatars/default.png",
"openid": "123",
"imported_alias": "第一个管理员",
"from_wechat": false,
"tags": [{
"id": 1,
"name": "b1",
"full_name": "bq-b1",
"color": "#e91e63",
"tag_group_id": 1,
"taggings_count": 9
}, {
"id": 3,
"name": "a1",
"full_name": "a1",
"color": "#ff5722",
"tag_group_id": 1,
"taggings_count": 4
}, {
"id": 8,
"name": "a2",
"full_name": "a2",
"color": "#673ab7",
"tag_group_id": 1,
"taggings_count": 1
}
}
]
GET /api/v4/tags/:id/taggable_users
Parameters
Name | Type | Description | Comments |
---|---|---|---|
id | integer | 标签id |
IdentityCertifications
获取人脸核身的链接
GET /api/v4/identity_certifications/new HTTP/1.1
Authorization: your_authorization
HTTP/1.1 200 OK
{
identity_vertify_url: #{identity_vertify_url}
}
GET /api/v4/identity_certifications/auth
Parameters
Name | Type | Description | Comments |
---|---|---|---|
redirect_url | integer | 回调地址,用于获取 BizToken |
用户绑定授权信息
GET /api/v4/identity_certifications/auth HTTP/1.1
Authorization: your_authorization
HTTP/1.1 201 CREATED
{
message: '实名信息创建成功'
}
GET /api/v4/identity_certifications/auth
Parameters
Name | Type | Description | Comments |
---|---|---|---|
user_id | integer | 用户id | |
BizToken | integer | 从人脸核身回调地址返回 |
Errors
Error Code | Meaning |
---|---|
403 | Unauthorized - 授权失败,参考上方的2种授权方式 |
404 | Not Found - 没有找到请求的资源 |
422 | Unprocessable - 更新资源时,验证失败 |
500 | Internal Server Error - 服务器有问题,请联系我们 |