人员管理
方法与权限
| API | GET | POST | PUT | PATCH | DELETE |
|---|---|---|---|---|---|
| 人员列表 | 管理员, 成员 | 管理员 | - | 管理员, 成员** | - |
| 人员详情 | 管理员, 成员 | - | - | 管理员, 成员** | - |
**成员只能更新以下字段:
- first_name
- last_name
- metadata
- dashboard
- should_receive_weekly_digest
- should_receive_statement_digest
- should_receive_mention_notification
- should_receive_record_change_notification
- should_receive_notification_email
获取组织人员列表
端点: /organizations/personnel/list/{level}/{sid}/{serializer}/
返回组织的成员信息。
参数:level (路径, 字符串)
organization
参数:sid (路径, 字符串)
organization sid
参数:serializer (路径, 字符串)
参数:token (请求头, 字符串)
响应:200
# serializer = name
{
"page_size": 10,
"page_number": 1,
"page_count": 1,
"count": 1,
"next": null,
"previous": null,
"add_permission": true,
"results": [
{
"sid": "xxx",
"name": "xxx"
}
]
}
# serializer = list
{
"page_size": 10,
"page_number": 1,
"page_count": 1,
"count": 1,
"next": null,
"previous": null,
"add_permission": true,
"results": [
{
"sid": "xxx",
"name": "xxx",
"email": "xxx@labii.com",
"title": "Administrator",
"is_administrator": true,
"is_archived": false,
"date_start": "2020-05-31",
"date_end": null,
"change_permission": true
}
]
}
# serializer = detail
{
"page_size": 10,
"page_number": 1,
"page_count": 1,
"count": 1,
"next": null,
"previous": null,
"add_permission": true,
"results": [
{
"sid": "xxx",
"name": "xxx",
"email": "xxx@labii.com",
"first_name": "xxx",
"last_name": "xxx",
"title": "Administrator",
"date_start": "2020-05-31",
"date_end": null,
"is_administrator": true,
"dashboard": [
{
"link": "https://docs.labii.com/quick-start",
"note": "1. Quick start guide"
},
...
],
"is_use_single_sign_on": true,
"should_receive_weekly_digest": true,
"should_receive_mention_notification": true,
"should_receive_record_change_notification": true,
"metadata": [
],
"is_archived": false,
"change_permission": true,
"updated_by": "xxx",
"date_updated": "2020-05-31T07:00:46.705116Z"
}
]
}
添加组织人员列表
端点: /organizations/personnel/list/{level}/{sid}/{serializer}/
创建一个或多个组织成员
参数:level (路径, 字符串)
organization
参数:sid (路径, 字符串)
organization sid
参数:serializer (路径, 字符串)
参数:token (请求头, 字符串)
参数:email (请求体, 字符串)
参数:first_name (请求体, 字符串)
参数:last_name (请求体, 字符串)
参数:title (请求体, 字符串)
参数:date_start (请求体, 字符串)
参数:date_end (请求体, 字符串)
参数:is_administrator (请求体, 字符串)
参数:is_archived (请求体, 字符串)
响应:201
{
"sid": "xxx",
"name": "xxx",
"email": "xxx@labii.com",
"first_name": "xxx",
"last_name": "xxx",
"title": "Administrator",
"date_start": "2020-05-31",
"date_end": null,
"is_administrator": true,
"dashboard": [
{
"link": "https://docs.labii.com/quick-start",
"note": "1. Quick start guide"
},
...
],
"is_use_single_sign_on": true,
"should_receive_weekly_digest": true,
"should_receive_mention_notification": true,
"should_receive_record_change_notification": true,
"metadata": [
],
"is_archived": false,
"change_permission": true,
"updated_by": "xxx",
"date_updated": "2020-05-31T07:00:46.705116Z"
}
响应:406
- The fields organization, user must make a unique set.
- Your organization does not have enough seats to add new members. Contact sales@labii.com to increase seats.
- Wrong email: xxx. Emails from academic or non-profile companies only.
获取组织人员详情
端点: /organizations/personnel/detail/{sid}/
获取成员的详细信息。
参数:sid (路径, 字符串)
响应:200
{
"sid": "xxx",
"name": "xxx",
"email": "xxx@labii.com",
"first_name": "xxx",
"last_name": "xxx",
"title": "Administrator",
"date_start": "2020-05-31",
"date_end": null,
"is_administrator": true,
"dashboard": [
{
"link": "https://docs.labii.com/quick-start",
"note": "1. Quick start guide"
},
...
],
"is_use_single_sign_on": true,
"should_receive_weekly_digest": true,
"should_receive_mention_notification": true,
"should_receive_record_change_notification": true,
"metadata": [
],
"is_archived": false,
"change_permission": true,
"updated_by": "xxx",
"date_updated": "2020-05-31T07:00:46.705116Z"
}
更新组织人员详情
端点: /organizations/personnel/detail/{sid}/
更新成员的数据
参数:sid (路径, 字符串)
参数:title (请求体, 字符串)
参数:date_start (请求体, 字符串)
参数:date_end (请求体, 字符串)
参数:is_administrator (请求体, 字符串)
参数:is_archived (请求体, 字符串)
响应:200
{
"sid": "xxx",
"name": "xxx",
"email": "xxx@labii.com",
"first_name": "xxx",
"last_name": "xxx",
"title": "Administrator",
"date_start": "2020-05-31",
"date_end": null,
"is_administrator": true,
"dashboard": [
{
"link": "https://docs.labii.com/quick-start",
"note": "1. Quick start guide"
},
...
],
"is_use_single_sign_on": true,
"should_receive_weekly_digest": true,
"should_receive_mention_notification": true,
"should_receive_record_change_notification": true,
"metadata": [
],
"is_archived": false,
"change_permission": true,
"updated_by": "xxx",
"date_updated": "2020-05-31T07:00:46.705116Z"
}