Enterprise Address Book Management Skill
is the provided command line program, all operations are completed by executing
commands.
Interact with the enterprise address book management system via
fx-api-cli corp <interface name> '<json input parameters>'
.
API List
corp.user.get — Get User Information API
bash
fx-api-cli corp user_get '{"user_id": "user_id_1"}'
Get detailed information of the specified user. User ID is required. See API Details.
corp.user.create — Create User API
bash
fx-api-cli corp user_create '{"name": "张三", "username": "zhangsan", "departments": [1]}'
Create a new user. Username, login name and department ID are required. See API Details.
corp.user.update — Update User API
bash
fx-api-cli corp user_update '{"user_id": "user_id_1", "name": "李四", "departments": [1, 2]}'
Update information of the specified user. User ID and the information to be updated are required. See API Details.
corp.user.delete — Delete User API
bash
fx-api-cli corp user_delete '{"user_id": "user_id_1"}'
Delete the specified user. User ID is required. See API Details.
corp.user.batch_delete — Batch Delete Users API
bash
fx-api-cli corp user_batch_delete '{"user_id_list": ["user_id_1", "user_id_2"]}'
Delete multiple users in batch. User ID list is required. See API Details.
corp.user.import — Import Users API
bash
fx-api-cli corp user_import '{"user_list": [{"name": "张三", "username": "zhangsan", "departments": [1]}, {"name": "李四", "username": "lisi", "departments": [2]}]}'
Import users in batch. User list is required. See API Details.
corp.depart.user_list — Get Department User List API
bash
fx-api-cli corp depart_user_list '{"dept_no": 1}'
Get user list of the specified department. Department number is required.
corp.depart.list — Get Department List API
bash
fx-api-cli corp depart_list '{}'
Get the department list of the enterprise. See API Details.
corp.depart.create — Create Department API
bash
fx-api-cli corp depart_create '{"name": "技术部", "parent_no": 0}'
Create a new department. Department name and parent department number are required. See API Details.
corp.depart.update — Update Department API
bash
fx-api-cli corp depart_update '{"dept_no": 1, "name": "研发部", "parent_no": 0}'
Update information of the specified department. Department number and the information to be updated are required. See API Details.
corp.depart.delete — Delete Department API
bash
fx-api-cli corp depart_delete '{"dept_no": 1}'
Delete the specified department. Department number is required. See API Details.
corp.depart.get — Get Department Information API
bash
fx-api-cli corp depart_get '{"dept_no": 1}'
Get detailed information of the specified department. Department number is required. See API Details.
corp.depart.import — Import Departments API
bash
fx-api-cli corp depart_import '{"dept_list": [{"name": "技术部", "parent_no": 0}, {"name": "产品部", "parent_no": 0}]}'
Import departments in batch. Department list is required. See API Details.
corp.role.list — Get Role List API
bash
fx-api-cli corp role_list '{}'
Get the role list of the enterprise.
corp.role.create — Create Role API
bash
fx-api-cli corp role_create '{"name": "管理员", "description": "系统管理员"}'
Create a new role. Role name and description are required.
corp.role.update — Update Role API
bash
fx-api-cli corp role_update '{"role_id": "role_id_1", "name": "超级管理员", "description": "系统超级管理员"}'
Update information of the specified role. Role ID and the information to be updated are required.
corp.role.delete — Delete Role API
bash
fx-api-cli corp role_delete '{"role_id": "role_id_1"}'
Delete the specified role. Role ID is required.
corp.role.user_list — Get Role User List API
bash
fx-api-cli corp role_user_list '{"role_id": "role_id_1"}'
Get user list of the specified role. Role ID is required.
corp.role.user_add — Add Role User API
bash
fx-api-cli corp role_user_add '{"role_id": "role_id_1", "user_id_list": ["user_id_1", "user_id_2"]}'
Add users to the specified role. Role ID and user ID list are required.
corp.role.user_remove — Remove Role User API
bash
fx-api-cli corp role_user_remove '{"role_id": "role_id_1", "user_id_list": ["user_id_1"]}'
Remove users from the specified role. Role ID and user ID list are required.
corp.role_group.list — Get Role Group List API
bash
fx-api-cli corp role_group_list '{}'
Get the role group list of the enterprise.
corp.role_group.create — Create Role Group API
bash
fx-api-cli corp role_group_create '{"name": "管理组", "description": "管理相关角色组"}'
Create a new role group. Role group name and description are required.
corp.role_group.update — Update Role Group API
bash
fx-api-cli corp role_group_update '{"group_id": "group_id_1", "name": "超级管理组", "description": "超级管理相关角色组"}'
Update information of the specified role group. Role group ID and the information to be updated are required.
corp.role_group.delete — Delete Role Group API
bash
fx-api-cli corp role_group_delete '{"group_id": "group_id_1"}'
Delete the specified role group. Role group ID is required.
corp.guest.depart_list — Get Guest Department List API
bash
fx-api-cli corp guest_depart_list '{}'
Get the guest department list of the enterprise.
corp.guest.user_list — Get Guest User List API
bash
fx-api-cli corp guest_user_list '{"dept_no": 1}'
Get user list of the specified guest department. Department number is required.
corp.guest.user_get — Get Guest User Information API
bash
fx-api-cli corp guest_user_get '{"user_id": "user_id_1"}'
Get detailed information of the specified guest user. User ID is required.
Core Rules
User ID Lookup Rules
- When a user needs to operate a user but does not provide a user ID:
- Call to get the department user list
- Filter users according to the conditions provided by the user (such as username, name, etc.)
- Matching Strategy:
- Exact match with unique result: use directly
- Fuzzy match with multiple results: display candidate list for user selection
- No matching result: inform the user that no match is found
Department Number Lookup Rules
- When a user needs to operate a department but does not provide a department number:
- Call to get the department list
- Filter departments according to the conditions provided by the user (such as department name)
- Matching Strategy:
- Exact match with unique result: use directly
- Fuzzy match with multiple results: display candidate list for user selection
- No matching result: inform the user that no match is found
Role ID Lookup Rules
- When a user needs to operate a role but does not provide a role ID:
- Call to get the role list
- Filter roles according to the conditions provided by the user (such as role name)
- Matching Strategy:
- Exact match with unique result: use directly
- Fuzzy match with multiple results: display candidate list for user selection
- No matching result: inform the user that no match is found
Operation Confirmation Rules
- Delete operation: You must confirm with the user before performing operations such as deleting users, departments, roles, etc.
- Batch operation: You must confirm the quantity and scope of the operation with the user before performing batch operations
Typical Workflows
Query User Information
User query examples:
- "Help me query user information"
- "View user details"
Execution process:
- Determine the of the target user through the User ID Lookup Rules
- Call to get user details
- Display the user's name, login name, department and other information
Create User
User query examples:
- "Help me create a new user"
- "Add user"
Execution process:
- Collect the user information provided by the user (name, login name, department, etc.)
- Call to create a user
- Display the creation result, including the ID of the new user
Update User
User query examples:
- "Help me update user information"
- "Modify user profile"
Execution process:
- Determine the of the target user through the User ID Lookup Rules
- Collect the updated content provided by the user
- Call to update user information
- Display the update result
Delete User
User query examples:
- "Help me delete a user"
- "Remove user"
Execution process:
- Determine the of the target user through the User ID Lookup Rules
- Confirm the deletion operation with the user
- Call to delete the user
- Display the deletion result
Query Department List
User query examples:
- "Help me query the department list"
- "View enterprise departments"
Execution process:
- Call to get the department list
- Display the name and number of each department
Create Department
User query examples:
- "Help me create a new department"
- "Add department"
Execution process:
- Collect the department information provided by the user (name, parent department, etc.)
- Call to create a department
- Display the creation result, including the number of the new department
Update Department
User query examples:
- "Help me update department information"
- "Modify department name"
Execution process:
- Determine the of the target department through the Department Number Lookup Rules
- Collect the updated content provided by the user
- Call to update department information
- Display the update result
Delete Department
User query examples:
- "Help me delete a department"
- "Remove department"
Execution process:
- Determine the of the target department through the Department Number Lookup Rules
- Confirm the deletion operation with the user
- Call to delete the department
- Display the deletion result
Query Role List
User query examples:
- "Help me query the role list"
- "View enterprise roles"
Execution process:
- Call to get the role list
- Display the name and ID of each role
Create Role
User query examples:
- "Help me create a new role"
- "Add role"
Execution process:
- Collect the role information provided by the user (name, description, etc.)
- Call to create a role
- Display the creation result, including the ID of the new role
Manage Role Users
User query examples:
- "Help me add users to the role"
- "Remove users from the role"
Execution process:
- Determine the of the target role through the Role ID Lookup Rules
- Collect the user ID list provided by the user
- Call or according to the operation type
- Display the operation result
Error Handling
- User not found: Clearly inform the user that the corresponding user is not found
- Department not found: Clearly inform the user that the corresponding department is not found
- Role not found: Clearly inform the user that the corresponding role is not found
- Insufficient permissions: Clearly inform the user that there is no permission to perform the operation
- API error: Display specific error information, retry if necessary
- Network problem: Actively retry up to 3 times when HTTP error occurs