本帖最后由 Bella.Yuan 于 2023-1-5 18:54 编辑
经常会有一些场景需要将Wyn Enterprise深度集成至客户系统中,这里提供一些与组织、角色、用户管理相关的API,以供参考。
添加组织:
POST /api/v1/organizations?token=67aed5646dc0127d9ec6240a1bb59cc3b6edd303d94be5dcbfae6b83585eba50 HTTP/1.1
Content-Type: application/json
body: {"id":"","name":"B","parentTenantId":null,"props":[]}
// parentTenantId 是父级组织ID
删除组织:
// ID:组织的ID (cc00c033-7c9d-4933-9916-ec43d26cafdb)
DELETE /api/v1/organizations/cc00c033-7c9d-4933-9916-ec43d26cafdb?token=67aed5646dc0127d9ec6240a1bb59cc3b6edd303d94be5dcbfae6b83585eba50 HTTP/1.1
获取组织信息:
GET /api/v1/organizations?includeProps=true&token=67aed5646dc0127d9ec6240a1bb59cc3b6edd303d94be5dcbfae6b83585eba50 HTTP/1.1
获取组织基础权限:
// ID:组织的ID (a8821415-58c6-4eeb-a45a-dc90025473e5)
GET /api/v1/organizations/a8821415-58c6-4eeb-a45a-dc90025473e5/permissions?token=67aed5646dc0127d9ec6240a1bb59cc3b6edd303d94be5dcbfae6b83585eba50 HTTP/1.1
设置组织默认基础权限:
// ID:组织的ID (a8821415-58c6-4eeb-a45a-dc90025473e5)
PUT /api/v1/organizations/a8821415-58c6-4eeb-a45a-dc90025473e5/permissions?token=67aed5646dc0127d9ec6240a1bb59cc3b6edd303d94be5dcbfae6b83585eba50 HTTP/1.1
Content-Type: application/json
body: {"permissions":["create-data-source","create-semantic-model","create-dataset","create-dashboard","view-dashboard","create-report","view-report","schedule-reports","create-input-form","view-revision","allow-sharing"]}
添加组织内角色:
// ID:组织的ID (b4ddcfa7-0dad-4ffd-8282-cd34c7eb534c)
POST /api/v1/organizations/b4ddcfa7-0dad-4ffd-8282-cd34c7eb534c/roles?token=67aed5646dc0127d9ec6240a1bb59cc3b6edd303d94be5dcbfae6b83585eba50 HTTP/1.1
Content-Type: application/json
body: {"name":"a2"}
设置组织内角色权限:
// ID:组织的ID (b4ddcfa7-0dad-4ffd-8282-cd34c7eb534c)
// ID:角色的ID (b723afd4-a9fe-4064-81d7-04f375dbf17a)
PUT /api/v1/organizations/b4ddcfa7-0dad-4ffd-8282-cd34c7eb534c/roles/b723afd4-a9fe-4064-81d7-04f375dbf17a/permissions?token=67aed5646dc0127d9ec6240a1bb59cc3b6edd303d94be5dcbfae6b83585eba50 HTTP/1.1
Content-Type: application/json
body: {"permissions":["allow-sharing","create-dashboard","create-data-source","create-dataset","create-input-form","create-report","create-semantic-model","schedule-reports","view-dashboard","view-report","view-revision"]}
组织内角色添加用户:
// ID:组织的ID (b4ddcfa7-0dad-4ffd-8282-cd34c7eb534c)
// ID:角色的ID (b723afd4-a9fe-4064-81d7-04f375dbf17a)
PUT /api/v1/organizations/b4ddcfa7-0dad-4ffd-8282-cd34c7eb534c/roles/b723afd4-a9fe-4064-81d7-04f375dbf17a/users?token=67aed5646dc0127d9ec6240a1bb59cc3b6edd303d94be5dcbfae6b83585eba50 HTTP/1.1
Content-Type: application/json
body: {"userIds":["035e4bca-85ea-4ad6-b655-97f1d0a18b05","fa248639-d585-4720-b259-bb89481d7d1f"]}
组织内角色删除用户:
// ID:组织的ID (b4ddcfa7-0dad-4ffd-8282-cd34c7eb534c)
// ID:角色的ID (b723afd4-a9fe-4064-81d7-04f375dbf17a)
// ID:用户的ID (035e4bca-85ea-4ad6-b655-97f1d0a18b05)
DELETE /api/v1/organizations/b4ddcfa7-0dad-4ffd-8282-cd34c7eb534c/roles/b723afd4-a9fe-4064-81d7-04f375dbf17a/users/035e4bca-85ea-4ad6-b655-97f1d0a18b05?token=67aed5646dc0127d9ec6240a1bb59cc3b6edd303d94be5dcbfae6b83585eba50 HTTP/1.1
添加全局角色:
POST /api/v1/roles?token=67aed5646dc0127d9ec6240a1bb59cc3b6edd303d94be5dcbfae6b83585eba50 HTTP/1.1
Content-Type: application/json
body: {"name":"1234"}
设置全局角色权限:
// ID:角色的ID (a4f7529e-fb30-4906-8c3f-e05472afe5e5)
POST /api/v1/roles/a4f7529e-fb30-4906-8c3f-e05472afe5e5/permissions?token=67aed5646dc0127d9ec6240a1bb59cc3b6edd303d94be5dcbfae6b83585eba50 HTTP/1.1
Content-Type: application/json
body: {"permissions":["allow-sharing","create-dashboard","create-data-source","create-dataset","create-input-form","create-report","create-semantic-model","schedule-reports","view-dashboard","view-report","view-revision"]}
全局角色添加用户:
// ID:角色的ID (a4f7529e-fb30-4906-8c3f-e05472afe5e5)
PUT /api/v1/roles/a4f7529e-fb30-4906-8c3f-e05472afe5e5/users?token=67aed5646dc0127d9ec6240a1bb59cc3b6edd303d94be5dcbfae6b83585eba50 HTTP/1.1
Content-Type: application/json
body: {"userIds":["338e9b56-c1e9-4a70-bf3a-ced4992039d7","fa248639-d585-4720-b259-bb89481d7d1f"]}
全局角色删除用户:
// ID:角色的ID (a4f7529e-fb30-4906-8c3f-e05472afe5e5)
// ID:用户的ID (fa248639-d585-4720-b259-bb89481d7d1f)
DELETE /api/v1/roles/a4f7529e-fb30-4906-8c3f-e05472afe5e5/users/fa248639-d585-4720-b259-bb89481d7d1f?token=67aed5646dc0127d9ec6240a1bb59cc3b6edd303d94be5dcbfae6b83585eba50 HTTP/1.1
新建全局用户:
POST /api/v1/users?token=67aed5646dc0127d9ec6240a1bb59cc3b6edd303d94be5dcbfae6b83585eba50 HTTP/1.1
Content-Type: application/json
body: {"username":"2","email":"2@qq.com","mobile":"","firstName":"","lastName":"","fullName":"","password":"2","confirmPassword":"2","roles":[],"customizePropertyInfo":{},"tenantId":null}
删除全局用户:
// ID:用户的ID (ed97210f-f428-4528-8a50-219ac1d39df8)
DELETE /api/v1/users/ed97210f-f428-4528-8a50-219ac1d39df8?token=67aed5646dc0127d9ec6240a1bb59cc3b6edd303d94be5dcbfae6b83585eba50 HTTP/1.1
新建组织用户:
// ID:组织的ID (a8821415-58c6-4eeb-a45a-dc90025473e5)
POST /api/v1/users?token=67aed5646dc0127d9ec6240a1bb59cc3b6edd303d94be5dcbfae6b83585eba50 HTTP/1.1
Content-Type: application/json
body: {"username":"2","email":"4@qq.com","mobile":"","firstName":"","lastName":"","fullName":"","password":"2","confirmPassword":"2","roles":[],"customizePropertyInfo":{},"tenantId":"a8821415-58c6-4eeb-a45a-dc90025473e5"}
删除组织用户:
// ID:组织的ID (a8821415-58c6-4eeb-a45a-dc90025473e5)
// ID:用户的ID (a38c7e38-3d64-487c-a6d0-7349eda1cb53)
DELETE /api/v1/organizations/a8821415-58c6-4eeb-a45a-dc90025473e5/users/a38c7e38-3d64-487c-a6d0-7349eda1cb53?token=67aed5646dc0127d9ec6240a1bb59cc3b6edd303d94be5dcbfae6b83585eba50 HTTP/1.1
获取用户信息:
GET /api/v1/users?Pageing=false&token=67aed5646dc0127d9ec6240a1bb59cc3b6edd303d94be5dcbfae6b83585eba50 HTTP/1.1
获取组织角色信息:
// ID:组织的ID (b4ddcfa7-0dad-4ffd-8282-cd34c7eb534c)
GET /api/v1/organizations/b4ddcfa7-0dad-4ffd-8282-cd34c7eb534c/roles?token=67aed5646dc0127d9ec6240a1bb59cc3b6edd303d94be5dcbfae6b83585eba50 HTTP/1.1
获取全局角色信息:
GET /api/v1/roles?token=67aed5646dc0127d9ec6240a1bb59cc3b6edd303d94be5dcbfae6b83585eba50 HTTP/1.1
|
|