eoffice-api

泛微 e-office 协同办公系统 OpenAPI - 用户管理、部门管理、审批流程、考勤等企业级 API

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "eoffice-api" with this command: npx skills add quanruxiaohong/eoffice-api

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_URLOA 系统部署地址https://oa.example.com/server
EOFFICE_AGENT_ID应用 Agent ID100001
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应用不存在
0x500003Token 无效或已过期
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

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Img2img

Generate images from text descriptions using DALL-E 3 while adhering to usage policies and avoiding realistic human faces.

Registry SourceRecently Updated
General

Habitat-GS-Navigator

Navigate and interact with photo-realistic 3DGS environments via the Habitat-GS Bridge. Use when: user asks to explore a 3D scene, perform embodied navigatio...

Registry SourceRecently Updated
General

Memory Palace

持久化记忆管理。Use when: 用户告诉你个人信息/偏好/习惯、需要记住项目状态/技术决策、完成任务后有可复用经验、用户说"记住""别忘了""下次注意"、需要回忆之前的对话内容。支持语义搜索和时间推理。

Registry SourceRecently Updated
General

Podcast Transcript Mining Authority Positioning

Extract guest appearances, speaking topics, and soundbites from podcast transcripts to build authority portfolios and generate podcast pitch templates. Use w...

Registry SourceRecently Updated