基本概念
例如:

API調用及樣本
1. 建立群組
如果需要建立一個根群組,需將is_root參數設定為true。 如果建立的不是根群組,則需要設定parent_group_id,並把is_root設定為false
請求樣本
{
"group_name": "某公司",
"is_root": true
}
{
"group_name": "研發部",
"is_root": false,
"parent_group_id": "929bf1cec48d4eb28a6cca0af29f1b8f"
}
響應樣本
{
"domain_id": "bj3231",
"group_id": "929bf1cec48d4eb28a6cca0af29f1b8f",
"group_name": "某公司",
"description": "",
"created_at": 1677335855709,
"updated_at": 1677335855709,
"creator": "",
"permission": null
}
2. 列舉群組成員
如需列舉所有根群組,則不傳group_id參數。
請求樣本
{
"group_id": "929bf1cec48d4eb28a6cca0af29f1b8f",
"limit": 100
}
響應樣本
{
"group_items": [
{
"domain_id": "bj3231",
"group_id": "ef6a45fa25f54aacae08a501269de4e4",
"group_name": "研發部",
"description": "",
"created_at": 1677336367210,
"updated_at": 1677336367210,
"creator": "",
"permission": null
}
],
"user_items": [],
"next_marker": ""
3. 新增成員到群組
此介面只允許添加使用者,群組可以在建立時通過parent_group_id來設定父群組
請求樣本
{
"group_id": "ef6a45fa25f54aacae08a501269de4e4",
"member_id": "39df109b4f4f428db75898bbb0644fa5",
"member_type": "user"
}
響應樣本
204 NoContent
4. 從群組移除成員
此介面只允許移除使用者,群組只能先將成員移除後再刪除。
請求樣本
{
"group_id": "ef6a45fa25f54aacae08a501269de4e4",
"member_id": "39df109b4f4f428db75898bbb0644fa5",
"member_type": "user"
}
響應樣本
204 NoContent
5. 刪除群組
此介面僅允許刪除沒有成員的群組。
請求樣本
{
"group_id": "ef6a45fa25f54aacae08a501269de4e4"
}
響應樣本
204 NoContent