-
Notifications
You must be signed in to change notification settings - Fork 2
组织api v4
huang wei edited this page Aug 14, 2018
·
1 revision
GET /api/v4/organizations
Parameters
None
Response
Status: 200 OK
X-SLP-Current-Page: 1
X-SLP-Total-Pages: 1
X-SLP-Total-Count: 4
[
{
"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
},
{
"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/roots
Parameters
None
Response
Status: 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/:id/children
Parameters
None
Response
Status: 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/members
Parameters
| Name | Type | Description |
|---|---|---|
| with_descendants | string | Optional 传任意值,代表包含子孙后代组织的成员 |
Response
Status: 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"
}
]