文章最后更新时间:2024年08月10日已超过844天没有更新。

注意事项
Origion指window.window.location.Origin。使用时请将其更换为真实的地址,同时注意端口。


在设计器中调试时需要删除URL中的“UserService”。

【小贴士】
因为每次打开设计器时所使用的端口可能都不一样,如果创建的命令过多的话,一个一个去修改服务器端口过于麻烦,可以这样来做:先创建一个获取管理站点URL的命令,将获取的管理站点地址存在一个变量里(如”url”),然后再发送HTTP请求命令的API地址内通过连接该变量来组成完整的API地址。
? 在请求正文中表示此属性为非必须,使用时请将其删除。

1 User(用户)
1.1 AddUsers(添加用户)
HTTP Verb:
POSTURL:
Origin/UserService/Manager/User/AddUsersRequest Body:
{ "UserInfos": [ { "UserName": "Bob", "FullName"?: "Bob Smith", "Password": "password123456", "Email": "Bob@email.com", "ExtendedProperties"?: { "Mentor": "Tom", "Address": "Beijing" } }, { "UserName": "Andy", "FullName"?: "Andy Brown", "Password": "password123456", "Email": "Andy@email.com", "ExtendedProperties"?: { "Mentor": "Tom", "Address": "Shanghai" } } ] }Return:
{ "Result": false, "Message": "Error message." }
| Param | Type | Comment | Optional | Default Value |
|---|---|---|---|---|
| UserInfos | List | User information collection | ||
| UserName | string | User name | ||
| FullName | string | User full name | true | null |
| Password | string | Password | ||
| string | ||||
| ExtendedProperties | object | Custom extended property | true | null |
1.2 AddWindowsUsers(添加Windows用户)
HTTP Verb:
POSTURL:
Origin/UserService/Manager/User/AddWindowsUsersRequest Body:
{ "UserInfos": [ { "UserName": "Alex", "ExtendedProperties"?: { "Mentor": "Vivian", "Address": "Chongqing" } }, { "UserName": "Ellen", "ExtendedProperties"?: { "Mentor": "Vivian", "Address": "Tianjin" } } ] }Return:
{ "Result": false, "Message": "Error message." }
| Param | Type | Comment | Optional | Default Value |
|---|---|---|---|---|
| UserInfos | List | Windows domain user information collection | ||
| UserName | string | User name | ||
| ExtendedProperties | object | Custom extended property | true | null |
1.3 DeleteUsers(删除用户)
HTTP Verb:
POSTURL:
Origin/UserService/Manager/User/DeleteUsersRequest Body:
{ "Users": ["Bob", "Andy"] }Return:
{ "Result": false, "Message": "Error message." }
| Param | Type | Comment |
|---|---|---|
| Users | List | User name collection |
1.4 DeleteWindowsUsers(删除Windows用户)
HTTP Verb:
POSTURL:
Origin/UserService/Manager/User/DeleteWindowsUsersRequest Body:
{ "Users": ["Alex", "Ellen"] }Return:
{ "Result": false, "Message": "Error message." }
| Param | Type | Comment |
|---|---|---|
| Users | List | Windows domain user name collection |
1.5 UpdateUserInfo(更新用户信息)
HTTP Verb:
POSTURL:
Origin/UserService/Manager/User/UpdateUserInfoRequest Body:
{ "UserName": "Bob", "FullName"?: "Bob Smith", "Email"?: "Bob2@email.com", "IsEnabled"?: false, "ExtendedProperties"?: { "Mentor": "Tom", "Address": "Shanghai" } }Return:
{ "Result": false, "Message": "Error message." }
| Param | Type | Comment | Optional | Default Value |
|---|---|---|---|---|
| UserName | string | User name | ||
| FullName | string | User full name | true | Original value |
| string | true | Original value | ||
| IsEnabled | string | Whether to enable user | true | Original value |
| ExtendedProperties | object | Custom extended property | true | Original value |
1.6 UpdateWindowsUserInfo(更新Windows用户信息)
HTTP Verb:
POSTURL:
Origin/UserService/Manager/User/UpdateWindowsUserInfo
Request Body:{ "UserName": "Alex", "Email"?: "Alex2@email.com", "ExtendedProperties"?: { "Mentor": "Vivian", "Address": "Beijing" } }Return:
{ "Result": false, "Message": "Error message." }
| Param | Type | Comment | Optional | Default Value |
|---|---|---|---|---|
| UserName | string | User name | ||
| string | true | Original value | ||
| ExtendedProperties | object | Custom extended property | true | Original value |
Note: If the value of Email is null or empty, the Email will set as the email of user in windows domain.
1.7 ResetUserPassword(重置用户密码)
HTTP Verb:
POSTURL:
Origin/UserService/Manager/User/ResetUserPasswordRequest Body:
{ "UserName": "Bob", "NewPassword": "123456password" }Return:
{ "Result": false, "Message": "Error message." }
| Param | Type | Comment |
|---|---|---|
| UserName | string | User name |
| NewPassword | string | New password |
1.8 GetUserInfo(获取用户信息)
HTTP Verb:
GETURL:
Origin/UserService/Manager/User/GetUserInfo?userName=BobReturn:
{ "Result": true, "Message": null, "UserInfo":{ "UserName": "Bob", "FullName": "Bob Smith", "Email": "Bob@email.com", "ExtendedProperties": { "Mentor": "Tom", "Address": "Beijing" }, "IsEnabled": true, "Roles": ["Intern", "Developer"], "OrganizationPaths": ["GrapeCity/Development1", "GrapeCity/Intern"] } }
| Param | Type | Comment |
|---|---|---|
| userName | string | User name |
1.9 GetWindowsUserInfo(获取Windws用户信息)
HTTP Verb:
GETURL:
Origin/UserService/Manager/User/GetWindowsUserInfo?userName=AlexReturn:
{ "Result": true, "Message": null, "UserInfo": { "UserName": "Alex", "FullName": "Alex", "Email": "Alex@email.com", "ExtendedProperties": { "Mentor": "Vivian", "Address": "Chongqing", }, "IsEnabled": true, "Roles": ["Intern", "Developer"], "OrganizationPaths": ["GrapeCity/Development1", "GrapeCity/Intern"] } }
| Param | Type | Comment |
|---|---|---|
| userName | string | User name |
1.10 GetUserInfos(获取用户信息)
HTTP Verb :
GETURL :
Origin/UserService/Manager/User/GetUserInfos?roleName=Developer
Return :{ "Result": true, "Message": null, "Users": [ { "Name": "Bob", "FullName": "Bob Smith", "Email": "Bob@email.com", "ExtendedProperties": { "Mentor": "Tom", "Address": "Beijing" }, "IsEnabled": true, "Roles": ["Intern", "Developer"], "Organizations": ["GrapeCity/Development1", "GrapeCity/Intern"] }, { "Name": "Andy", "FullName": "Andy Brown" "Email": "Andy@email.com", "ExtendedProperties": { "Mentor": "Tom", "Address": "Shanghai" }, "IsEnabled": true, "Roles": ["Developer"], "Organizations": ["GrapeCity/Development2", "GrapeCity/Club/Basketball"] } ] }
| Param | Type | Comment | Optional | Default Value |
|---|---|---|---|---|
| roleName | string | Role name | true | null |
1.11 GetWindowsUserInfos(获取Windws用户信息)
HTTP Verb:
GETURL:
Origin/UserService/Manager/User/GetWindowsUserInfos?roleName=DeveloperReturn:
{ "Result": true, "Message": null, "Users": [ { "Name": "Alex", "FullName": "Alex", "Email": "Alex@email.com", "ExtendedProperties": { "Mentor": "Vivian", "Address": "Chongqing" }, "IsEnabled": true, "Roles": ["Intern", "Developer"], "Organizations": ["GrapeCity/Development1", "GrapeCity/Intern"] }, { "Name": "Ellen", "FullName": "Ellen Johnson", "Email": "Ellen@email.com", "ExtendedProperties": { "Mentor": "Vivian", "Address": "Tianjin" }, "IsEnabled": true, "Roles": ["Developer"], "Organizations": ["GrapeCity/Development2", "GrapeCity/Club/Basketball"] } ] }
| Param | Type | Comment | Optional | Default Value |
|---|---|---|---|---|
| roleName | string | Role name | true | null |
2 Role(角色)
2.1 AddRole(添加角色)
HTTP Verb:
POSTURL:
Origin/UserService/Manager/Role/AddRoleRequest Body:
{ "RoleName": "Intern" }Return :
{ "Result": false, "Message": "Error message." }
| Param | Type | Comment |
|---|---|---|
| RoleName | string | Role name |
2.2 DeleteRole(删除角色)
HTTP Verb:
POSTURL:
Origin/UserService/Manager/Role/DeleteRoleRequest Body:
{ "RoleName": "Intern" }Return:
{ "Result": false, "Message": "Error message." }
| Param | Type | Comment |
|---|---|---|
| RoleName | string | Role name |
2.3 UpdateRoleName(更新角色名)
HTTP Verb:
POSTURL:
Origin/UserService/Manager/Role/UpdateRoleNameRequest Body:
{ "OldRoleName": "Intern", "NewRoleName": "Newbie" }Return:
{ "Result": false, "Message": "Error message." }
| Param | Type | Comment |
|---|---|---|
| OldRoleName | string | Old role name |
| NewRoleName | string | New role name |
2.4 GetRoles(获取角色)
HTTP Verb:
GETURL:
Origin/UserService/Manager/Role/GetRolesReturn:
{ "Result": true, "Message": null, "Roles": ["Intern", "Developer", "Tester", "PM"] }
2.5 AddUsersToRole(添加用户到角色)
HTTP Verb:
POSTURL:
Origin/UserService/Manager/Role/AddUsersToRoleRequest Body:
{ "Users": ["Bob", "Andy"], "RoleName": "Developer" }Return:
{ "Result": false, "Message": "Error message." }
| Param | Type | Comment |
|---|---|---|
| Users | List | User name collection |
| RoleName | string | Role name |
2.6 AddWindowsUsersToRole(添加Windws用户到角色)
HTTP Verb:
POSTURL:
Origin/UserService/Manager/Role/AddWindowsUsersToRoleRequest Body:
{ "Users":["Alex", "Ellen"], "RoleName": "Developer" }Return:
{ "Result": false, "Message": "Error message." }
| Param | Type | Comment |
|---|---|---|
| Users | List | Windows domain user name collection |
| RoleName | string | Role name |
2.7 RemoveUsersFromRole(从角色中删除用户)
HTTP Verb:
POSTURL:
Origin/UserService/Manager/Role/RemoveUsersFromRoleRequest Body:
{ "Users": ["Bob", "Andy"], "RoleName": "Intern" }Return:
{ "Result": false, "Message": "Error message." }
| Param | Type | Comment |
|---|---|---|
| Users | List | user name collection |
| RoleName | string | Role name |
2.8 RemoveWindowsUsersFromRole(从角色中删除Windws用户)
HTTP Verb:
POSTURL:
Origin/UserService/Manager/Role/RemoveWindowsUsersFromRoleRequest Body:
{ "Users": ["Alex", "Ellen"], "RoleName": "Intern" }Return:
{ "Result": false, "Message": "Error message." }
| Param | Type | Comment |
|---|---|---|
| Users | List | Windows domain user name collection |
| RoleName | string | Role name |
3 Organization(组织结构)
3.1 AddOrganizationLevel(添加组织级别)
HTTP Verb :
POSTURL:
Origin/UserService/Manager/Organization/AddOrganizationLevelRequest Body:
{ "OrganizationLevelName": "Company" }Return:
{ "Result": false, "Message": "Error message." }
| Param | Type | Comment |
|---|---|---|
| OrganizationLevelName | string | Organization level name |
3.2 DeleteOrganizationLevel(删除组织级别)
HTTP Verb:
POSTURL:
Origin/UserService/Manager/Organization/DeleteOrganizationLevelRequest Body:
{ "OrganizationLevelName": "SubDepartment" }Return:
{ "Result": false, "Message": "Error message." }
| Param | Type | Comment |
|---|---|---|
| OrganizationLevelName | string | Organization level name |
3.3 UpdateOrganizationLevel(更新组织级别)
HTTP Verb:
POSTURL:
Origin/UserService/Manager/Organization/UpdateOrganizationLevelRequest Body:
{ "OldOrganizationLevelName": "Company", "NewOrganizationLevelName": "Corporation" }Return:
{ "Result": false, "Message": "Error message." }
| Param | Type | Comment |
|---|---|---|
| OldOrganizationLevelName | string | Old organization level name |
| NewOrganizationLevelName | string | New organization level name |
3.4 GetOrganizationLevels(获取组织级别)
HTTP Verb:
GETURL:
Origin/UserService/Manager/Organization/GetOrganizationLevelsReturn:
{ "Result": true, "Message": null, "OrganizationLevels": ["Company", "Department", "SubDepartment"] }
3.5 AddOrganization(添加组织结构)
HTTP Verb:
POSTURL:
Origin/UserService/Manager/Organization/AddOrganizationRequest Body :
{ "OrganizationName": "Group1", "ParentOrganizationPath": "GrapeCity/Development1", "OrganizationLevel"?: "SubDepartment" }Return:
{ "Result": false, "Message": "Error message." }
| Param | Type | Comment | Optional | Default Value |
|---|---|---|---|---|
| OrganizationName | string | Organization level | ||
| ParentOrganizationPath | string | Parent organization path | ||
| OrganizationLevel | string | Organization level | true | null |
Note: When ParentOrganizationPath is null or empty, it represents the root node.
3.6 DeleteOrganization(删除组织结构)
HTTP Verb:
POSTURL:
Origin/UserService/Manager/Organization/DeleteOrganizationRequest Body:
{ "OrganizationPath": "GrapeCity/Development1/Group1" }Return :
{ "Result": false, "Message": "Error message." }
| Param | Type | Comment |
|---|---|---|
| OrganizationPath | string | Organization path |
3.7 UpdateOrganizationInfo(更新组织结构信息)
HTTP Verb:
POSTURL:
Origin/UserService/Manager/Organization/UpdateOrganizationInfoRequest Body:
{ "OldOrganizationName": "Group1", "ParentOrganizationPath": "GrapeCity/Development1", "NewOrganizationName"?: "Group2", "NewOrganizationLevel"?: "Department" }Return:
{ "Result": false, "Message": "Error message." }
| Param | Type | Comment | Optional | Default Value |
|---|---|---|---|---|
| OldOrganizationName | string | Old organization name | ||
| ParentOrganizationPath | string | Parent organization path | ||
| NewOrganizationName | string | New organization name | true | Original value |
| NewOrganizationLevel | string | New organization level | true Original value |
Note: When ParentOrganizationPath is null or empty, it represents the root node。
3.9 GetOrganizationInfos(获取组织结构信息)
HTTP Verb:
GETURL:
Origin/UserService/Manager/Organization/GetOrganizationInfos?organizationPath=GrapeCity/Development1&isRecursive=trueReturn:
{ "Result": true, "Message": null, "OrganizationInfos": [ { "ParentOrganizationPath": "", "OrganizationPath": "GrapeCity", "OrganizationName": "GrapeCity", "OrganizationLevelName": "Company", "SubOrganizations": [ { "ParentOrganizationPath": "GrapeCity", "OrganizationPath": "GrapeCity/Development1", "OrganizationName": "Development1", "OrganizationLevelName": "Department", "SubOrganizations": [...], "Members": [...] } ], "Members": [ { "UserName": "David", "IsWindowsUser": false, "IsLeader": false, "OrganizationRole": "Intern" }, { "UserName": "Alex", "IsWindowsUser": true, "IsLeader": true, "OrganizationRole": "Developer" } ] }, { "ParentOrganizationPath": "", "OrganizationPath": "GrapeSeed", "OrganizationName": "GrapeSeed", "OrganizationLevelName": "Company", "SubOrganizations": [ { "ParentOrganizationPath": "GrapeSeed", "OrganizationPath": "GrapeSeed/Development1", "OrganizationName": "Development1", "OrganizationLevelName": "Department", "SubOrganizations": [...], "Members": [...] } ], "Members": [ { "UserName": "David", "IsWindowsUser": false, "IsLeader": false, "OrganizationRole": "Intern" }, { "UserName": "Alex", "IsWindowsUser": true, "IsLeader": false, "OrganizationRole": "Teacher" } ] } ] }
| Param | Type | Comment | Optional | Default Value |
|---|---|---|---|---|
| organizationPath | string | Organization Path | true | null |
| isRecursive bool | Is recursive suborganization info | true | true |
Note: When organizationPath is null or empty, it represents the root node.
3.10 AddUsersToOrganization(添加用户至组织结构)
HTTP Verb:
POSTURL:
Origin/UserService/Manager/Organization/AddUsersToOrganizationRequest Body:
{ "Users": [ { "UserName": "Bob", "IsLeader"?: false, "OrganizationRole"?: "Intern" }, { "UserName": "Andy", "IsLeader"?: false, "OrganizationRole"?: "Developer" } ], "OrganizationPath": "GrapeCity/Development1/Group1" }Return:
{ "Result": false, "Message": "Error message." }
| Param | Type | Comment | Optional | Default Value |
|---|---|---|---|---|
| Users | List | User information collection | ||
| UserName | string | User name | ||
| IsLeader | bool | Is leader of organization | true | false |
| OrganizationRole | string | User role in organization | true | null |
| OrganizationPath | string | Organization path |
3.11 AddWindowsUsersToOrganization(添加Windws用户至组织结构)
HTTP Verb:
POSTURL:
Origin/UserService/Manager/Organization/AddWindowsUsersToOrganizationRequest Body:
{ "Users": [ { "UserName": "Alex", "IsLeader"?: false, "OrganizationRole"?: "Intern" }, { "UserName": "Ellen", "IsLeader"?: false, "OrganizationRole"?: "Developer" } ], "OrganizationPath": "GrapeCity/Development1/Group1" }Return:
{ "Result": false, "Message": "Error message." }
| Param | Type | Comment | Optional | Default Value |
|---|---|---|---|---|
| Users | List | Windows domain user information collection | ||
| UserName | string | User name | ||
| IsLeader | bool | Is leader of organization | true | false |
| OrganizationRole | string | User role in organization | true | null |
| OrganizationPath | string | Organization path |
3.12 RemoveUsersFromOrganization(从组织结构中删除用户)
HTTP Verb:
POSTURL:
Origin/UserService/Manager/Organization/RemoveUsersFromOrganizationRequest Body:
{ "Users": ["Bob", "Andy"], "OrganizationPath": "GrapeCity/Development1/Group1" }Return:
{ "Result": false, "Message": "Error message." }
| Param | Type | Comment |
|---|---|---|
| Users | List | User name collection |
| OrganizationPath | string | Organization path |
3.13 RemoveWindowsUsersFromOrganization(从组织结构中删除Windws用户)
HTTP Verb:
POSTURL:
Origin/UserService/Manager/Organization/RemoveWindowsUsersFromOrganizationRequest Body :
{ "Users": ["Alex", "Ellen"], "OrganizationPath": "GrapeCity/Development1/Group1" }Return:
{ "Result": false, "Message": "Error message." }
| Param | Type | Comment |
|---|---|---|
| Users | List | Windows domain user name collection |
| OrganizationPath | string | Organization path |
3.14 MoveEntireOrganization(移动整个组织结构)
HTTP Verb:
POSTURL:
Origin/UserService/Manager/Organization/MoveEntireOrganizationRequest Body:
{ "OrganizationPath": "GrapeCity/Development1/Group1", "NewParentOrganizationPath": "GrapeCity/Development2" }Return:
{ "Result": false, "Message": "Error message." }
| Param | Type | Comment |
|---|---|---|
| OrganizationPath | string | Organization path |
| NewParentOrganizationPath | string | New parent organization path |
Note: When NewParentOrganizationPath is null or empty, it represents the root node.
4 ExtendedProperty(自定义属性)
4.1 AddExtendedProperty(添加自定义属性)
HTTP Verb:
POSTURL:
Origin/UserService/Manager/ExtendedProperty/AddExtendedPropertyRequest Body:
{ "PropertyName": "Address", "PropertyType": "Text" }Return:
{ "Result": false, "Message": "Error message." }
| Param | Type | Comment |
|---|---|---|
| PropertyName | string | Property name |
| PropertyType | string | Property type |
Note: PropertyType can only be “Text” or “User”.
4.2 DeleteExtendedProperty(删除自定义属性)
HTTP Verb:
POSTURL:
Origin/UserService/Manager/ExtendedProperty/DeleteExtendedPropertyRequest Body:
{ "PropertyName": "Address" }Return:
{ "Result": false, "Message": "Error message." }
| Param | Type | Comment |
|---|---|---|
| PropertyName | string | Property name |
4.3 UpdateExtendedPropertyName(更新自定义属性名)
HTTP Verb:
POSTURL:
Origin/UserService/Manager/ExtendedProperty/UpdateExtendedPropertyNameRequest Body:
{ "OldPropertyName": "Address", "NewPropertyName": "Hometown" }Return:
{ "Result": false, "Message": "Error message." }
| Param | Type | Comment |
|---|---|---|
| OldPropertyName | string | Old poperty name |
| NewPropertyName | string | New property name |
4.4 GetExtendedProperties(获取自定义属性)
HTTP Verb:
GETURL:
Origin/UserService/Manager/ExtendedProperty/GetExtendedPropertiesReturn:
{ "Result": true, "Message": null, "ExtendedProperties": [ { "PropertyName": "Mentor", "PropertyType": "User" }, { "PropertyName": "Address", "PropertyType": "Text" } ] }


