活字格用户管理接口(HuoZiGe API)

cuinew

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

活字格用户管理接口(HuoZiGe API)

注意事项

  • Origion指window.window.location.Origin。使用时请将其更换为真实的地址,同时注意端口。
    活字格用户管理接口(HuoZiGe API)
    活字格用户管理接口(HuoZiGe API)

  • 在设计器中调试时需要删除URL中的“UserService”。
    活字格用户管理接口(HuoZiGe API)

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

  • ? 在请求正文中表示此属性为非必须,使用时请将其删除。
    活字格用户管理接口(HuoZiGe API)

1 User(用户)

1.1 AddUsers(添加用户)

  • HTTP Verb:POST

  • URL:Origin/UserService/Manager/User/AddUsers

  • Request 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."
    }
ParamTypeCommentOptionalDefault Value
UserInfosListUser information collection

UserNamestringUser name

FullNamestringUser full nametruenull
PasswordstringPassword

EmailstringEmail

ExtendedPropertiesobjectCustom extended propertytruenull

1.2 AddWindowsUsers(添加Windows用户)

  • HTTP Verb:POST

  • URL:Origin/UserService/Manager/User/AddWindowsUsers

  • Request Body:

    {
      "UserInfos": [
          {
          "UserName": "Alex",
          "ExtendedProperties"?: {
              "Mentor": "Vivian", 
              "Address": "Chongqing"
              }
          },
          {
          "UserName": "Ellen",
          "ExtendedProperties"?: {
              "Mentor": "Vivian",
              "Address": "Tianjin"
              }
          }
      ]
    }
  • Return:

    {
      "Result": false,
      "Message": "Error message."
    }
ParamTypeCommentOptionalDefault Value
UserInfosListWindows domain user information collection

UserNamestringUser name

ExtendedPropertiesobjectCustom extended propertytruenull

1.3 DeleteUsers(删除用户)

  • HTTP Verb:POST

  • URL:Origin/UserService/Manager/User/DeleteUsers

  • Request Body:

    {
      "Users": ["Bob", "Andy"]
    }
  • Return:

    {
      "Result": false,
      "Message": "Error message."
    }
ParamTypeComment
UsersListUser name collection

1.4 DeleteWindowsUsers(删除Windows用户)

  • HTTP Verb:POST

  • URL:Origin/UserService/Manager/User/DeleteWindowsUsers

  • Request Body:

    {
      "Users": ["Alex", "Ellen"]
    }
  • Return:

    {
      "Result": false,
      "Message": "Error message."
    }
ParamTypeComment
UsersListWindows domain user name collection

1.5 UpdateUserInfo(更新用户信息)

  • HTTP Verb:POST

  • URL:Origin/UserService/Manager/User/UpdateUserInfo

  • Request Body:

    {
      "UserName": "Bob",
      "FullName"?: "Bob Smith",
      "Email"?: "Bob2@email.com",
      "IsEnabled"?: false,
      "ExtendedProperties"?: {
          "Mentor": "Tom",
          "Address": "Shanghai"
      }
    }
  • Return:

    {
      "Result": false,
      "Message": "Error message."
    }
ParamTypeCommentOptionalDefault Value
UserNamestringUser name

FullNamestringUser full nametrueOriginal value
EmailstringEmailtrueOriginal value
IsEnabledstringWhether to enable usertrueOriginal value
ExtendedPropertiesobjectCustom extended propertytrueOriginal value

1.6 UpdateWindowsUserInfo(更新Windows用户信息)

  • HTTP Verb:POST

  • URL:Origin/UserService/Manager/User/UpdateWindowsUserInfo
    Request Body:

    {
      "UserName": "Alex",
      "Email"?: "Alex2@email.com",
      "ExtendedProperties"?: {
          "Mentor": "Vivian",
          "Address": "Beijing"
      }
    }
  • Return:

    {
      "Result": false,
      "Message": "Error message."
    }
ParamTypeCommentOptionalDefault Value
UserNamestringUser name

EmailstringEmailtrueOriginal value
ExtendedPropertiesobjectCustom extended propertytrueOriginal 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:POST

  • URL:Origin/UserService/Manager/User/ResetUserPassword

  • Request Body:

    {
      "UserName": "Bob",
      "NewPassword": "123456password"
    }
  • Return:

    {
      "Result": false,
      "Message": "Error message."
    }
ParamTypeComment
UserNamestringUser name
NewPasswordstringNew password

1.8 GetUserInfo(获取用户信息)

  • HTTP Verb:GET

  • URL:Origin/UserService/Manager/User/GetUserInfo?userName=Bob

  • Return:

    {
      "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"]
      }
    }
ParamTypeComment
userNamestringUser name

1.9 GetWindowsUserInfo(获取Windws用户信息)

  • HTTP Verb:GET

  • URL:Origin/UserService/Manager/User/GetWindowsUserInfo?userName=Alex

  • Return:

    {
      "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"]
       }
    }
ParamTypeComment
userNamestringUser name

1.10 GetUserInfos(获取用户信息)

  • HTTP Verb : GET

  • URL : 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"]
          }
      ]
    }
ParamTypeCommentOptionalDefault Value
roleNamestringRole nametruenull

1.11 GetWindowsUserInfos(获取Windws用户信息)

  • HTTP Verb:GET

  • URL:Origin/UserService/Manager/User/GetWindowsUserInfos?roleName=Developer

  • Return:

    {
      "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"]
          }
      ]
    }
ParamTypeCommentOptionalDefault Value
roleNamestringRole nametruenull

2 Role(角色)

2.1 AddRole(添加角色)

  • HTTP Verb:POST

  • URL:Origin/UserService/Manager/Role/AddRole

  • Request Body:

    {
      "RoleName": "Intern"
    }
  • Return :

    {
      "Result": false,
      "Message": "Error message."
    }
ParamTypeComment
RoleNamestringRole name

2.2 DeleteRole(删除角色)

  • HTTP Verb:POST

  • URL:Origin/UserService/Manager/Role/DeleteRole

  • Request Body:

    {
      "RoleName": "Intern"
    }
  • Return:

    {
      "Result": false,
      "Message": "Error message."
    }
ParamTypeComment
RoleNamestringRole name

2.3 UpdateRoleName(更新角色名)

  • HTTP Verb:POST

  • URL:Origin/UserService/Manager/Role/UpdateRoleName

  • Request Body:

    {
      "OldRoleName": "Intern",
      "NewRoleName": "Newbie"
    }
  • Return:

    {
      "Result": false,
      "Message": "Error message."
    }
ParamTypeComment
OldRoleNamestringOld role name
NewRoleNamestringNew role name

2.4 GetRoles(获取角色)

  • HTTP Verb:GET

  • URL:Origin/UserService/Manager/Role/GetRoles

  • Return:

    {
      "Result": true,
      "Message": null,
      "Roles": ["Intern", "Developer", "Tester", "PM"]
    }

2.5 AddUsersToRole(添加用户到角色)

  • HTTP Verb:POST

  • URL:Origin/UserService/Manager/Role/AddUsersToRole

  • Request Body:

    {
      "Users": ["Bob", "Andy"],
      "RoleName": "Developer"
    }
  • Return:

    {
      "Result": false,
      "Message": "Error message."
    }
ParamTypeComment
UsersListUser name collection
RoleNamestringRole name

2.6 AddWindowsUsersToRole(添加Windws用户到角色)

  • HTTP Verb:POST

  • URL:Origin/UserService/Manager/Role/AddWindowsUsersToRole

  • Request Body:

    {
      "Users":["Alex", "Ellen"],
      "RoleName": "Developer"
    }
  • Return:

    {
      "Result": false,
      "Message": "Error message."
    }
ParamTypeComment
UsersListWindows domain user name collection
RoleNamestringRole name

2.7 RemoveUsersFromRole(从角色中删除用户)

  • HTTP Verb:POST

  • URL:Origin/UserService/Manager/Role/RemoveUsersFromRole

  • Request Body:

    {
      "Users": ["Bob", "Andy"],
      "RoleName": "Intern" 
    }
  • Return:

    {
      "Result": false,
      "Message": "Error message."
    }
ParamTypeComment
UsersListuser name collection
RoleNamestringRole name

2.8 RemoveWindowsUsersFromRole(从角色中删除Windws用户)

  • HTTP Verb:POST

  • URL:Origin/UserService/Manager/Role/RemoveWindowsUsersFromRole

  • Request Body:

    {
      "Users": ["Alex", "Ellen"],
      "RoleName": "Intern"
    }
  • Return:

    {
      "Result": false,
      "Message": "Error message."
    }
ParamTypeComment
UsersListWindows domain user name collection
RoleNamestringRole name

3 Organization(组织结构)

3.1 AddOrganizationLevel(添加组织级别)

  • HTTP Verb : POST

  • URL:Origin/UserService/Manager/Organization/AddOrganizationLevel

  • Request Body:

    {
      "OrganizationLevelName": "Company"
    }
  • Return:

    {
      "Result": false,
      "Message": "Error message."
    }
ParamTypeComment
OrganizationLevelNamestringOrganization level name

3.2 DeleteOrganizationLevel(删除组织级别)

  • HTTP Verb:POST

  • URL:Origin/UserService/Manager/Organization/DeleteOrganizationLevel

  • Request Body:

    {
      "OrganizationLevelName": "SubDepartment"
    }
  • Return:

    {
      "Result": false,
      "Message": "Error message."
    }
ParamTypeComment
OrganizationLevelNamestringOrganization level name

3.3 UpdateOrganizationLevel(更新组织级别)

  • HTTP Verb:POST

  • URL:Origin/UserService/Manager/Organization/UpdateOrganizationLevel

  • Request Body:

    {
      "OldOrganizationLevelName": "Company",
      "NewOrganizationLevelName": "Corporation"
    }
  • Return:

    {
      "Result": false,
      "Message": "Error message."
    }
ParamTypeComment
OldOrganizationLevelNamestringOld organization level name
NewOrganizationLevelNamestringNew organization level name

3.4 GetOrganizationLevels(获取组织级别)

  • HTTP Verb:GET

  • URL:Origin/UserService/Manager/Organization/GetOrganizationLevels

  • Return:

    {
      "Result": true,
      "Message": null,
      "OrganizationLevels": ["Company", "Department", "SubDepartment"]
    }

3.5 AddOrganization(添加组织结构)

  • HTTP Verb:POST

  • URL:Origin/UserService/Manager/Organization/AddOrganization

  • Request Body :

    {
      "OrganizationName": "Group1",
      "ParentOrganizationPath": "GrapeCity/Development1",
      "OrganizationLevel"?: "SubDepartment"
    }
  • Return:

    {
      "Result": false,
      "Message": "Error message."
    }
ParamTypeCommentOptionalDefault Value
OrganizationNamestringOrganization level

ParentOrganizationPathstringParent organization path

OrganizationLevelstringOrganization leveltruenull

Note: When ParentOrganizationPath is null or empty, it represents the root node.

3.6 DeleteOrganization(删除组织结构)

  • HTTP Verb:POST

  • URL:Origin/UserService/Manager/Organization/DeleteOrganization

  • Request Body:

    {
      "OrganizationPath": "GrapeCity/Development1/Group1"
    }
  • Return :

    {
      "Result": false,
      "Message": "Error message."
    }
ParamTypeComment
OrganizationPathstringOrganization path

3.7 UpdateOrganizationInfo(更新组织结构信息)

  • HTTP Verb:POST

  • URL:Origin/UserService/Manager/Organization/UpdateOrganizationInfo

  • Request Body:

    {
      "OldOrganizationName": "Group1",
      "ParentOrganizationPath": "GrapeCity/Development1",
      "NewOrganizationName"?: "Group2",
      "NewOrganizationLevel"?: "Department"
    }
  • Return:

    {
      "Result": false,
      "Message": "Error message."
    }
ParamTypeCommentOptionalDefault Value
OldOrganizationNamestringOld organization name

ParentOrganizationPathstringParent organization path

NewOrganizationNamestringNew organization nametrueOriginal value
NewOrganizationLevelstringNew organization leveltrue    Original value

Note: When ParentOrganizationPath is null or empty, it represents the root node。

3.9 GetOrganizationInfos(获取组织结构信息)

  • HTTP Verb:GET

  • URL:Origin/UserService/Manager/Organization/GetOrganizationInfos?organizationPath=GrapeCity/Development1&isRecursive=true

  • Return:

    {
      "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"
                  }
              ]
          }
      ]
    }
ParamTypeCommentOptionalDefault Value
organizationPathstringOrganization Pathtruenull
isRecursive    boolIs recursive suborganization infotruetrue

Note: When organizationPath is null or empty, it represents the root node.

3.10 AddUsersToOrganization(添加用户至组织结构)

  • HTTP Verb:POST

  • URL:Origin/UserService/Manager/Organization/AddUsersToOrganization

  • Request Body:

    {
      "Users": [
          {
              "UserName": "Bob",
              "IsLeader"?: false,
              "OrganizationRole"?: "Intern"
          },
          {
              "UserName": "Andy",
              "IsLeader"?: false,
              "OrganizationRole"?: "Developer"
          }
      ],
      "OrganizationPath": "GrapeCity/Development1/Group1"
    }
  • Return:

    {
      "Result": false,
      "Message": "Error message."
    }
ParamTypeCommentOptionalDefault Value
UsersListUser information collection

UserNamestringUser name

IsLeaderboolIs leader of organizationtruefalse
OrganizationRolestringUser role in organizationtruenull
OrganizationPathstringOrganization path

3.11 AddWindowsUsersToOrganization(添加Windws用户至组织结构)

  • HTTP Verb:POST

  • URL:Origin/UserService/Manager/Organization/AddWindowsUsersToOrganization

  • Request Body:

    {
      "Users": [
          {
              "UserName": "Alex",
              "IsLeader"?: false,
              "OrganizationRole"?: "Intern"
          },
          {
              "UserName": "Ellen",
              "IsLeader"?: false,
              "OrganizationRole"?: "Developer"
          }
      ],
      "OrganizationPath": "GrapeCity/Development1/Group1"
    }
  • Return:

    {
      "Result": false,
      "Message": "Error message."
    }
ParamTypeCommentOptionalDefault Value
UsersListWindows domain user information collection

UserNamestringUser name

IsLeaderboolIs leader of organizationtruefalse
OrganizationRolestringUser role in organizationtruenull
OrganizationPathstringOrganization path

3.12 RemoveUsersFromOrganization(从组织结构中删除用户)

  • HTTP Verb:POST

  • URL:Origin/UserService/Manager/Organization/RemoveUsersFromOrganization

  • Request Body:

    {
      "Users": ["Bob", "Andy"],
      "OrganizationPath": "GrapeCity/Development1/Group1"
    }
  • Return:

    {
      "Result": false,
      "Message": "Error message."
    }
ParamTypeComment
UsersListUser name collection
OrganizationPathstringOrganization path

3.13 RemoveWindowsUsersFromOrganization(从组织结构中删除Windws用户)

  • HTTP Verb:POST

  • URL:Origin/UserService/Manager/Organization/RemoveWindowsUsersFromOrganization

  • Request Body :

    {
      "Users": ["Alex", "Ellen"],
      "OrganizationPath": "GrapeCity/Development1/Group1"
    }
  • Return:

    {
      "Result": false,
      "Message": "Error message."
    }
ParamTypeComment
UsersListWindows domain user name collection
OrganizationPathstringOrganization path

3.14 MoveEntireOrganization(移动整个组织结构)

  • HTTP Verb:POST

  • URL:Origin/UserService/Manager/Organization/MoveEntireOrganization

  • Request Body:

    {
      "OrganizationPath": "GrapeCity/Development1/Group1",
      "NewParentOrganizationPath": "GrapeCity/Development2"
    }
  • Return:

    {
      "Result": false,
      "Message": "Error message."
    }
ParamTypeComment
OrganizationPathstringOrganization path
NewParentOrganizationPathstringNew parent organization path

Note: When NewParentOrganizationPath is null or empty, it represents the root node.

4 ExtendedProperty(自定义属性)

4.1 AddExtendedProperty(添加自定义属性)

  • HTTP Verb:POST

  • URL:Origin/UserService/Manager/ExtendedProperty/AddExtendedProperty

  • Request Body:

    {
      "PropertyName": "Address",
      "PropertyType": "Text"
    }
  • Return:

    {
      "Result": false,
      "Message": "Error message."
    }
ParamTypeComment
PropertyNamestringProperty name
PropertyTypestringProperty type

Note: PropertyType can only be “Text” or “User”.

4.2 DeleteExtendedProperty(删除自定义属性)

  • HTTP Verb:POST

  • URL:Origin/UserService/Manager/ExtendedProperty/DeleteExtendedProperty

  • Request Body:

    {
      "PropertyName": "Address"
    }
  • Return:

    {
      "Result": false,
      "Message": "Error message."
    }
ParamTypeComment
PropertyNamestringProperty name

4.3 UpdateExtendedPropertyName(更新自定义属性名)

  • HTTP Verb:POST

  • URL:Origin/UserService/Manager/ExtendedProperty/UpdateExtendedPropertyName

  • Request Body:

    {
      "OldPropertyName": "Address", 
      "NewPropertyName": "Hometown"
    }
  • Return:

    {
      "Result": false,
      "Message": "Error message."
    }
ParamTypeComment
OldPropertyNamestringOld poperty name
NewPropertyNamestringNew property name

4.4 GetExtendedProperties(获取自定义属性)

  • HTTP Verb:GET

  • URL:Origin/UserService/Manager/ExtendedProperty/GetExtendedProperties

  • Return:

    {
      "Result": true,
      "Message": null,
      "ExtendedProperties": [
          {
              "PropertyName": "Mentor",
              "PropertyType": "User"
          },
          {
              "PropertyName": "Address",
              "PropertyType": "Text"
          }
      ]
    }
文章版权声明:除非注明,否则均为崔牛网原创文章,转载或复制请以超链接形式并注明出处。

目录[+]

取消
微信二维码
微信二维码
支付宝二维码