← Back to Skills Marketplace
quanruxiaohong

泛微 e-office v11 协同办公系统 OpenAPI

by quanruxiaohong · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ✓ Security Clean
157
Downloads
1
Stars
0
Active Installs
2
Versions
Install in OpenClaw
/install eoffice-api
Description
泛微 e-office 协同办公系统 OpenAPI - 用户管理、部门管理、审批流程、考勤等企业级 API
README (SKILL.md)

e-office10 OpenAPI Skill

当用户提到以下场景时使用此 skill:

  • 查询/搜索企业内部用户信息
  • 新建/编辑/删除用户账号
  • 查询部门组织架构
  • 发起或审批工作流程
  • 查询考勤记录
  • 发送内部通知消息
  • 管理客户或合同信息
  • 任何需要操作 OA 系统的任务

认证方式

本 skill 使用自定义 token 流程,与 OAuth2 类似但更简单:

首次使用步骤

  1. 获取 Token(调用 scripts/get-token.py

    python scripts/get-token.py
    

    这会向 OA 系统发送请求,用环境变量中的 EOFFICE_AGENT_IDEOFFICE_SECRETEOFFICE_USER 换取访问 token。

  2. Token 自动管理

    • Agent 会自动缓存 token
    • Token 过期时自动重新获取
    • 无需手动管理

环境配置

安装 skill 后,用户需要提供以下环境变量(在 OpenClaw 配置中设置):

环境变量 必填 说明 示例
EOFFICE_BASE_URL OA 系统部署地址 https://oa.example.com/server
EOFFICE_AGENT_ID 应用 Agent ID 100001
EOFFICE_SECRET 应用密钥 abc123def456...
EOFFICE_USER 用户标识(工号/账号/手机号) admin18612345678

如何获取凭证:

  1. 登录 OA 系统管理后台
  2. 进入「集成中心」→「OpenAPI」
  3. 创建应用,获取 Agent IDSecret
  4. 配置用户识别字段(工号/账号/手机号)
  5. 将用户账号填入 EOFFICE_USER

使用方法

用户管理

查询用户列表

curl -X GET "$EOFFICE_BASE_URL/api/hrm/lists" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{"page": 1, "limit": 10}'

查询单个用户详情

curl -X GET "$EOFFICE_BASE_URL/api/hrm/detail/{user_id}" \
  -H "Authorization: Bearer {token}"

新建用户

curl -X POST "$EOFFICE_BASE_URL/api/hrm/add" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "user_accounts": "zhangsan",
    "user_name": "张三",
    "dept_id": 1,
    "role_id": [1, 2],
    "user_status": 1,
    "allow_login": 1,
    "wap_allow": 1,
    "sex": 1
  }'

编辑用户

curl -X POST "$EOFFICE_BASE_URL/api/hrm/edit" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "user_id": "WV00000001",
    "user_accounts": "zhangsan",
    "user_name": "张三(已修改)",
    "dept_id": 2,
    "role_id": [1],
    "user_status": 1,
    "allow_login": 1,
    "wap_allow": 1,
    "sex": 1
  }'

删除用户

curl -X POST "$EOFFICE_BASE_URL/api/hrm/delete/{user_id}" \
  -H "Authorization: Bearer {token}"

部门管理

获取部门列表(树形)

curl -X GET "$EOFFICE_BASE_URL/api/department/allTree" \
  -H "Authorization: Bearer {token}"

获取部门详情

curl -X GET "$EOFFICE_BASE_URL/api/department/detail/{dept_id}" \
  -H "Authorization: Bearer {token}"

常用查询示例

搜索用户(按姓名模糊搜索)

GET /api/hrm/lists
Body: {"search": {"user_name": ["张", "like"]}}

获取用户在某个部门的用户列表

GET /api/department/users/{dept_id}

获取用户的上级领导

GET /api/hrm/superior/{user_id}

获取用户的下级下属

GET /api/hrm/subordinate/{user_id}

响应格式

所有 API 返回格式统一:

成功:

{
  "status": 1,
  "data": { ... }
}

失败:

{
  "status": 0,
  "errors": [
    {"code": "0x000003", "message": "未知错误"}
  ]
}

错误码

错误码 说明
0x000003 未知错误
0x500001 参数缺失
0x500002 应用不存在
0x500003 Token 无效或已过期
0x500004 语言环境无效
0x500005 用户不存在
0x500006 用户不在白名单内
0x500007 无账号人员不支持生成 Token

注意事项

  1. 敏感操作:删除用户等敏感操作需要管理员权限
  2. 用户状态user_status 字段标识用户是否在职,离职用户通常 user_status 为特定值
  3. 部门 ID:新建用户需要指定 dept_id,可先调用部门列表 API 查询
  4. 角色 IDrole_id 是数组,指定用户的权限角色
  5. Token 有效期:默认 Token 有效期由 OA 系统配置,通常为数小时

完整 API 文档

详见 references/api.md

Usage Guidance
This skill appears to do what it says: it needs your e-office Base URL, Agent ID, Secret, and a user identifier to obtain tokens and call OA APIs. Before installing: (1) verify the skill's source/maintainer — the repository homepage is a placeholder (https://github.com/yourname) and the package owner is unknown; prefer an official or audited source; (2) ensure EOFFICE_BASE_URL points to your trusted OA instance (do not point it at a third-party server you don't control); (3) treat EOFFICE_SECRET as sensitive — use least-privilege application credentials and consider creating an app scoped only to required operations; (4) be aware get-token.py prints tokens to stdout (which could be captured in logs/transcripts) — confirm your agent/platform handles secrets and logs securely; (5) confirm whether your OpenClaw agent runtime provides secure token caching/refresh — SKILL.md claims automatic caching but the repo provides only a helper script, not persistent storage. If any of the above concerns are unacceptable, review or host the code yourself and test the script locally before enabling the skill in production.
Capability Analysis
Type: OpenClaw Skill Name: eoffice-api Version: 1.0.1 The eoffice-api skill is a legitimate integration for the Weaver e-office (泛微) OA system, providing tools for user and department management. The included Python script (scripts/get-token.py) correctly implements the standard OpenAPI authentication flow using environment variables, and the documentation (SKILL.md, references/api.md) accurately reflects the official API structure without any signs of malicious intent, data exfiltration, or prompt injection.
Capability Assessment
Purpose & Capability
Name/description, declared env vars (EOFFICE_BASE_URL, EOFFICE_AGENT_ID, EOFFICE_SECRET, EOFFICE_USER), example curl commands and the included get-token.py script all align with a client for e-office OpenAPI. No unrelated cloud credentials, binaries, or config paths are requested.
Instruction Scope
SKILL.md instructs the agent to call scripts/get-token.py to obtain a token and then call the documented OA endpoints. The README and script only perform HTTP requests to the provided EOFFICE_BASE_URL. Two items to note: (1) SKILL.md states the agent "will automatically cache token / refresh when expired" — the repository contains a refresh helper but no persistent cache implementation, so caching is an agent/platform responsibility (possible minor mismatch between claim and provided code); (2) the get-token.py prints the token to stdout, which may expose tokens in logs or agent transcripts if not handled carefully.
Install Mechanism
No install spec is provided (instruction-only skill with a small helper script). The only runtime dependency is Python + requests (not unusual). There are no downloads from arbitrary URLs or archive extraction steps. Risk from install mechanism is low.
Credentials
Required env vars (base URL, agent id, secret, user) are appropriate for the described OpenAPI. The get-token.py script also optionally reads EOFFICE_TOKEN and EOFFICE_REFRESH_TOKEN for refresh flow; those are not listed as required in SKILL.md but are optional and reasonable. All requested variables are OA-specific and proportionate — no unrelated secrets are requested.
Persistence & Privilege
Skill does not request always:true and does not ask to modify other skills or system settings. It claims token caching and automatic refresh, which is normal for API client behavior; persistent storage of tokens would be handled by the agent/runtime, not the skill files themselves.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install eoffice-api
  3. After installation, invoke the skill by name or use /eoffice-api
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.1
- README 中添加了 OA 开放平台应用管理的外部说明链接 - 其余内容无变更(SKILL.md 未修改)
v1.0.0
Initial release of the eoffice-api skill. - Provides OpenAPI access to 泛微 e-office for user management, department management, workflows, attendance, and notifications. - Includes details for environment variable configuration and authentication token management. - Describes common API endpoints for creating, editing, querying, and deleting users and departments. - Lists standard response formats and error codes for API integration. - Offers usage examples and guidance for typical operations within OA systems.
Metadata
Slug eoffice-api
Version 1.0.1
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 2
Frequently Asked Questions

What is 泛微 e-office v11 协同办公系统 OpenAPI?

泛微 e-office 协同办公系统 OpenAPI - 用户管理、部门管理、审批流程、考勤等企业级 API. It is an AI Agent Skill for Claude Code / OpenClaw, with 157 downloads so far.

How do I install 泛微 e-office v11 协同办公系统 OpenAPI?

Run "/install eoffice-api" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is 泛微 e-office v11 协同办公系统 OpenAPI free?

Yes, 泛微 e-office v11 协同办公系统 OpenAPI is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does 泛微 e-office v11 协同办公系统 OpenAPI support?

泛微 e-office v11 协同办公系统 OpenAPI is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created 泛微 e-office v11 协同办公系统 OpenAPI?

It is built and maintained by quanruxiaohong (@quanruxiaohong); the current version is v1.0.1.

💬 Comments